Method and apparatus for processing imagae signal

ABSTRACT

Embodiments of the disclosure provide a method and apparatus for processing video signals. An image signal decoding method according to an embodiment of the disclosure comprises the steps of: determining, on the basis of the height and width of a current block, an input length and output length of a non-separable transform; determining a non-separable transform matrix corresponding to the input length and output length of the non-separable transform; and applying the non-separable transform matrix to the current block, wherein, when the height and width of the current block are 4 each, the input length and output length of the non-separable transform are determined to be 8 and 16 respectively.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is the National Stage filing under 35 U.S.C. 371 ofInternational Application No. PCT/KR2019/011252, filed on Sep. 2, 2019,which claims the benefit of U.S. Patent Applications No. 62/726,298,filed on Sep. 2, 2018, the contents of which are all hereby incorporatedby reference herein in their entirety.

TECHNICAL FIELD

The present disclosure relates to a method and apparatus for processingimage signals, and particularly, to a method and apparatus for encodingor decoding image signals by performing a transform.

BACKGROUND ART

Compression coding refers to a signal processing technique fortransmitting digitalized information through a communication line orstoring the same in an appropriate form in a storage medium. Media suchas video, images and audio can be objects of compression coding and,particularly, a technique of performing compression coding on images iscalled video image compression.

Next-generation video content will have features of a high spatialresolution, a high frame rate and high dimensionality of scenerepresentation. To process such content, memory storage, a memory accessrate and processing power will significantly increase.

Therefore, it is necessary to design a coding tool for processingnext-generation video content more efficiently. Particularly, videocodec standards after the high efficiency video coding (HEVC) standardrequire an efficient transform technique for transforming a spatialdomain video signal into a frequency domain signal along with aprediction technique with higher accuracy.

DETAILED DESCRIPTION OF THE DISCLOSURE Technical Problem

Embodiments of the disclosure provide an image signal processing methodand device that adopts a high coding-efficiency and low-complexitytransform.

The technical problems solved by the present disclosure are not limitedto the above technical problems and other technical problems which arenot described herein will become apparent to those skilled in the artfrom the following description.

Technical Solution

According to an embodiment of the disclosure, a method for decoding animage signal comprises determining an input length and an output lengthof a non-separable transform based on a height and a width of a currentblock, determining a non-separable transform matrix corresponding to theinput length and the output length of a non-separable transform, andapplying the non-separable transform matrix to coefficients by a numberof the input length in the current block, wherein, if each of the heightand the width of a current block is equal to 4, the input length of thenon-separable transform is determined as 8, and the output length of thenon-separable transform is determined as 16.

Further, if each of the height and the width of a current block is notequal to 8, the input length and the output length of the non-separabletransform is determined as 16.

Further, applying the non-separable transform matrix comprises applyingthe non-separable transform matrix to a top-left 4×4 region of thecurrent block if each of the height and the width of a current block isnot equal to 4 and a multiplication of the width and the height is lessthan a threshold value.

Further, applying the non-separable transform matrix comprises applyingthe non-separable transform matrix to a top-left 4×4 region of thecurrent block and a 4×4 region located at a right side of the top-left4×4 region, if each of the height and the width of a current block isnot equal to 4 and the width is greater than or equal to the height.

Further, applying the non-separable transform matrix comprises applyingthe non-separable transform matrix to a top-left 4×4 region of thecurrent block and a 4×4 region located at a bottom side of the top-left4×4 region, if each of the height and the width of a current block isnot equal to 4, a multiplication of the width and the height is greaterthan or equal to the threshold value, and the width is less than theheight.

Further, determining the non-separable transform matrix comprisesdetermining a non-separable transform set index based on an intraprediction mode of the current block, determining a non-separabletransform kernel corresponding to a non-separable transform index innon-separable transform set included in the non-separable transform setindex, and determining the non-separable transform matrix from thenon-separable transform based on the input length and the output length.

According to another embodiment of the disclosure, an apparatus fordecoding an image signal comprises a memory configured to store theimage signal and a processor coupled to the memory, wherein theprocessor is configured to determine an input length and an outputlength of a non-separable transform based on a height and a width of acurrent block, determine a non-separable transform matrix correspondingto the input length and the output length of a non-separable transform,and apply the non-separable transform matrix to coefficients by a numberof the input length in the current block, wherein, if each of the heightand the width of a current block is equal to 4, the input length of thenon-separable transform is determined as 8, and the output length of thenon-separable transform is determined as 16.

Advantageous Effects

According to the embodiments of the disclosure, it is possible toprovide a video coding method and device with high coding efficiency andlow complexity by applying a transform based on the size of the currentblock.

The effects of the present disclosure are not limited to theabove-described effects and other effects which are not described hereinwill become apparent to those skilled in the art from the followingdescription.

BRIEF DESCRIPTION OF DRAWINGS

A more complete appreciation of the disclosure and many of the attendantaspects thereof will be readily obtained as the same becomes betterunderstood by reference to the following detailed description whenconsidered in connection with the accompanying drawings, wherein:

FIG. 1 is a block diagram schematically illustrating an encoding deviceto encode video/image signals according to an embodiment of thedisclosure;

FIG. 2 is a block diagram schematically illustrating a decoding deviceto decode image signals according to an embodiment of the disclosure;

FIGS. 3A, 3B, 3C, and 3D are views illustrating block split structuresby quad tree (QT), binary tree (BT), ternary tree (TT), and asymmetrictree (AT), respectively, according to embodiments of the disclosure;

FIG. 4 is a block diagram schematically illustrating the encoding deviceof FIG. 1, which includes a transform and quantization unit, accordingto an embodiment of the disclosure and

FIG. 5 is a block diagram schematically illustrating a decoding deviceincluding an inverse-quantization and inverse-transform unit accordingto an embodiment of the disclosure;

FIG. 6 is a flowchart illustrating an example of encoding a video signalvia primary transform and secondary transform according to an embodimentof the disclosure;

FIG. 7 is a flowchart illustrating an example of decoding a video signalvia secondary inverse-transform and primary inverse-transform accordingto an embodiment of the disclosure;

FIG. 8 illustrates an example transform configuration group to whichadaptive multiple transform (AMT) applies, according to an embodiment ofthe disclosure;

FIG. 9 is a flowchart illustrating encoding to which AMT is appliedaccording to an embodiment of the disclosure;

FIG. 10 is a flowchart illustrating decoding to which AMT is appliedaccording to an embodiment of the disclosure;

FIG. 11 is a flowchart illustrating an example of encoding an AMT flagand an AMT index according to an embodiment of the disclosure;

FIG. 12 is a flowchart illustrating example decoding for performingtransform based on an AMT flag and an AMT index;

FIG. 13 is a diagram illustrating Givens rotation according to anembodiment of the disclosure, and FIG. 14 illustrates a configuration ofone round in a 4×4 NSST constituted of permutations and a Givensrotation layer according to an embodiment of the disclosure;

FIG. 15 illustrates an example configuration of non-split transform setper intra prediction mode according to an embodiment of the disclosure;

FIG. 16 illustrates three forward scan orders on transform coefficientsor transform coefficient blocks, wherein (a) illustrates a diagonalscan, (b) illustrates a horizontal scan, and (c) illustrates a verticalscan;

FIG. 17 illustrates the position of the transform coefficient in a casea forward diagonal scan is applied when 4×4 RST applies to a 4×8 block,according to an embodiment of the disclosure, and FIG. 18 illustrates anexample of merging the valid transform coefficients of two 4×4 blocksinto a single block according to an embodiment of the disclosure;

FIG. 19 illustrates an example method of configuring a mixed NSST setper intra prediction mode according to an embodiment of the disclosure;

FIG. 20 illustrates an example method of selecting an NSST set (orkernel) considering the size of transform block and an intra predictionmode according to an embodiment of the disclosure;

FIGS. 21A and 21B illustrate forward and inverse reduced transformaccording to an embodiment of the disclosure;

FIG. 22 is a flowchart illustrating an example of decoding using areduced transform according to an embodiment of the disclosure;

FIG. 23 is a flowchart illustrating an example for applying aconditional reduced transform according to an embodiment of thedisclosure;

FIG. 24 is a flowchart illustrating an example of decoding for secondaryinverse-transform to which a conditional reduced transform applies,according to an embodiment of the disclosure;

FIGS. 25A, 25B, 26A, and 26B illustrate examples of reduced transformand reduced inverse-transform according to an embodiment of thedisclosure;

FIG. 27 illustrates an example area to which a reduced secondarytransform applies according to an embodiment of the disclosure;

FIG. 28 illustrates a reduced transform per a reduced factor accordingto an embodiment of the disclosure;

FIG. 29 is a flowchart illustrating an example of decoding to which atransform applies according to an embodiment of the disclosure;

FIG. 30 is a block diagram illustrating a device for processing videosignals according to an embodiment of the disclosure;

FIG. 31 illustrates an example video coding system according to anembodiment of the disclosure; and

FIG. 32 is a view illustrating a structure of a convent streaming systemaccording to an embodiment of the disclosure.

MODE FOR CARRYING OUT THE DISCLOSURE

Some embodiments of the present disclosure are described in detail withreference to the accompanying drawings. A detailed description to bedisclosed along with the accompanying drawings are intended to describesome embodiments of the present disclosure and are not intended todescribe a sole embodiment of the present disclosure. The followingdetailed description includes more details in order to provide fullunderstanding of the present disclosure. However, those skilled in theart will understand that the present disclosure may be implementedwithout such more details.

In some cases, in order to avoid that the concept of the presentdisclosure becomes vague, known structures and devices are omitted ormay be shown in a block diagram form based on the core functions of eachstructure and device.

Although most terms used in the present disclosure have been selectedfrom general ones widely used in the art, some terms have beenarbitrarily selected by the applicant and their meanings are explainedin detail in the following description as needed. Thus, the presentdisclosure should be understood with the intended meanings of the termsrather than their simple names or meanings.

Specific terms used in the following description have been provided tohelp understanding of the present disclosure, and the use of suchspecific terms may be changed in various forms without departing fromthe technical sprit of the present disclosure. For example, signals,data, samples, pictures, frames, blocks and the like may beappropriately replaced and interpreted in each coding process.

In the present description, a “processing unit” refers to a unit inwhich an encoding/decoding process such as prediction, transform and/orquantization is performed. Further, the processing unit may beinterpreted into the meaning including a unit for a luma component and aunit for a chroma component. For example, the processing unit maycorrespond to a block, a coding unit (CU), a prediction unit (PU) or atransform unit (TU).

In addition, the processing unit may be interpreted into a unit for aluma component or a unit for a chroma component. For example, theprocessing unit may correspond to a coding tree block (CTB), a codingblock (CB), a PU or a transform block (TB) for the luma component.Further, the processing unit may correspond to a CTB, a CB, a PU or a TBfor the chroma component. Moreover, the processing unit is not limitedthereto and may be interpreted into the meaning including a unit for theluma component and a unit for the chroma component.

In addition, the processing unit is not necessarily limited to a squareblock and may be configured as a polygonal shape having three or morevertexes.

As used herein, “pixel” and “coefficient” (e.g., a transform coefficientor a transform coefficient that has undergone first transform) may becollectively referred to as a sample. When a sample is used, this maymean that, e.g., a pixel value or coefficient (e.g., a transformcoefficient or a transform coefficient that has undergone firsttransform) is used.

Hereinafter, a method of designing and applying a reduced secondarytransform (RST) considering the computational complexity in the worstcase scenario is described in relation to encoding/decoding of stillimages or videos.

Embodiments of the disclosure provide methods and devices forcompressing images and videos. Compressed data has the form of abitstream, and the bitstream may be stored in various types of storageand may be streamed via a network to a decoder-equipped terminal. If theterminal has a display device, the terminal may display the decodedimage on the display device or may simply store the bitstream data. Themethods and devices proposed according to embodiments of the disclosureare applicable to both encoders and decoders or both bitstreamgenerators and bitstream receivers regardless of whether the terminaloutputs the same through the display device.

An image compressing device largely includes a prediction unit, atransform and quantization unit, and an entropy coding unit. FIGS. 1 and2 are block diagrams schematically illustrating an encoding device and adecoding device, respectively. Of the components, the transform andquantization unit transforms the residual signal, which results fromsubtracting the prediction signal from the raw signal, into afrequency-domain signal via, e.g., discrete cosine transform (DCT)-2 andapplies quantization to the frequency-domain signal, thereby enablingimage compression, with the number of non-zero signals significantlyreduced.

FIG. 1 is a block diagram schematically illustrating an encoding deviceto encode video/image signals according to an embodiment of thedisclosure.

The image splitter 110 may split the image (or picture or frame) inputto the encoding device 100 into one or more processing units. As anexample, the processing unit may be referred to as a coding unit (CU).In this case, the coding unit may be recursively split into from acoding tree unit (CTU) or largest coding unit (LCU), according to aquad-tree binary-tree (QTBT) structure. For example, one coding unit maybe split into a plurality of coding units of a deeper depth based on thequad tree structure and/or binary tree structure. In this case, forexample, the quad tree structure may be applied first, and the binarytree structure may then be applied. Or, the binary tree structure may beapplied first. A coding procedure according to an embodiment of thedisclosure may be performed based on the final coding unit that is notany longer split. In this case, the largest coding unit may immediatelybe used as the final coding unit based on, e.g., coding efficiency perimage properties or, as necessary, the coding unit may be recursivelysplit into coding units of a lower depth, and the coding unit of theoptimal size may be used as the final coding unit. The coding proceduremay include, e.g., prediction, transform, or reconstruction describedbelow. As an example, the proceeding unit may further include theprediction unit PU or transform unit TU. In this case, the predictionunit and transform unit each may be split into or partitioned from theabove-described final coding unit. The prediction unit may be a unit ofsample prediction, and the transform unit may be a unit for deriving thetransform coefficient and/or a unit for deriving the residual signalfrom the transform coefficient.

The term “unit” may be interchangeably used with “block” or “area” insome cases. Generally, M×N block may denote a set of samples ortransform coefficients consisting of M columns and N rows. Generally,sample may denote the pixel or pixel value or may denote the pixel/pixelvalue of only the luma component or the pixel/pixel value of only thechroma component. Sample may be used as a term corresponding to thepixel or pel of one picture (or image).

The encoding device 100 may generate a residual signal (residual blockor residual sample array) by subtracting the prediction signal(predicted block or prediction sample array) output from the interpredictor 180 or intra predictor 185 from the input image signal (rawblock or raw sample array), and the generated residual signal istransmitted to the transformer 120. In this case, as shown, the unit forsubtracting the prediction signal (prediction block or prediction samplearray) from the input image signal (raw block or raw sample array) inthe encoder 100 may be referred to as the subtractor 115. The predictormay perform prediction on the target block for processing (hereinafter,current block) and generate a predicted block including predictionsamples for the current block. The predictor may determine whether intraprediction or inter prediction is applied in each block or CU unit. Thepredictor may generate various pieces of information for prediction,such as prediction mode information, as described below in connectionwith each prediction mode, and transfer the generated information to theentropy encoder 190. The prediction-related information may be encodedby the entropy encoder 190 and be output in the form of a bitstream.

The intra predictor 185 may predict the current block by referencing thesamples in the current picture. The referenced samples may neighbor, orbe positioned away from, the current block depending on the predictionmode. In the intra prediction, the prediction modes may include aplurality of non-directional modes and a plurality of directional modes.The non-directional modes may include, e.g., a DC mode and a planarmode. The directional modes may include, e.g., 33 directional predictionmodes or 65 directional prediction modes depending on how elaborate theprediction direction is. However, this is merely an example, and more orless directional prediction modes may be used. The intra predictor 185may determine the prediction mode applied to the current block using theprediction mode applied to the neighboring block.

The inter predictor 180 may derive a predicted block for the currentblock, based on a reference block (reference sample array) specified bya motion vector on the reference picture. Here, to reduce the amount ofmotion information transmitted in the inter prediction mode, the motioninformation may be predicted per block, subblock, or sample based on thecorrelation in motion information between the neighboring block and thecurrent block. The motion information may include the motion vector anda reference picture index. The motion information may further includeinter prediction direction (L0 prediction, L1 prediction, or Biprediction) information. In the case of inter prediction, neighboringblocks may include a spatial neighboring block present in the currentpicture and a temporal neighboring block present in the referencepicture. The reference picture including the reference block may beidentical to, or different from, the reference picture including thetemporal neighboring block. The temporal neighboring block may betermed, e.g., co-located reference block or co-located CU (colCU), andthe reference picture including the temporal neighboring block may betermed a co-located picture (colPic). For example, the inter predictor180 may construct a motion information candidate list based onneighboring blocks and generate information indicating what candidate isused to derive the motion vector and/or reference picture index of thecurrent block. Inter prediction may be performed based on variousprediction modes. For example, in skip mode or merge mode, the interpredictor 180 may use the motion information for the neighboring blockas motion information for the current block. In skip mode, unlike inmerge mode, no residual signal may be transmitted. In motion vectorprediction (MVP) mode, the motion vector of the neighboring block may beused as a motion vector predictor, and a motion vector difference may besignaled, thereby indicating the motion vector of the current block.

The prediction signal generated via the inter predictor 180 or intrapredictor 185 may be used to generate a reconstructed signal or aresidual signal.

The transformer 120 may apply a transform scheme to the residual signal,generating transform coefficients. For example, the transform scheme mayinclude at least one of a discrete cosine transform (DCT), discrete sinetransform (DST), Karhunen-Loeve transform (KLT), graph-based transform(GBT), or conditionally non-linear transform (CNT). The GBT means atransform obtained from a graph in which information for therelationship between pixels is represented. The CNT means a transformthat is obtained based on generating a prediction signal using allpreviously reconstructed pixels. Further, the transform process mayapply to squared pixel blocks with the same size or may also apply tonon-squared, variable-size blocks.

The quantizer 130 may quantize transform coefficients and transmit thequantized transform coefficients to the entropy encoder 190, and theentropy encoder 190 may encode the quantized signal (information for thequantized transform coefficients) and output the encoded signal in abitstream. The information for the quantized transform coefficients maybe referred to as residual information. The quantizer 130 may re-sortthe block-shaped quantized transform coefficients in the form of aone-dimension vector, based on a coefficient scan order and generate theinformation for the quantized transform coefficients based on theone-dimensional form of quantized transform coefficients. The entropyencoder 190 may perform various encoding methods, such as, e.g.,exponential Golomb, context-adaptive variable length coding (CAVLC), orcontext-adaptive binary arithmetic coding (CABAC). The entropy encoder190 may encode the values of pieces of information (e.g., syntaxelements) necessary to reconstruct the video/image, along with orseparately from the quantized transform coefficients. The encodedinformation (e.g., video/image information) may be transmitted or storedin the form of a bitstream, on a per-network abstraction layer (NAL)unit basis. The bitstream may be transmitted via the network or bestored in the digital storage medium. The network may include, e.g., abroadcast network and/or communication network, and the digital storagemedium may include, e.g., USB, SD, CD, DVD, Blu-ray, HDD, SSD, or othervarious storage media. A transmitter (not shown) for transmitting,and/or a storage unit (not shown) storing, the signal output from theentropy encoder 190 may be configured as an internal/external element ofthe encoding device 100, or the transmitter may be a component of theentropy encoder 190.

The quantized transform coefficients output from the quantizer 130 maybe used to generate the prediction signal. For example, the residualsignal may be reconstructed by applying inverse quantization and inversetransform on the quantized transform coefficients via the inversequantizer 140 and inverse transformer 150 in the loop. The adder 155 mayadd the reconstructed residual signal to the prediction signal outputfrom the inter predictor 180 or intra predictor 185, thereby generatingthe reconstructed signal (reconstructed picture, reconstructed block, orreconstructed sample array). As in the case where skip mode is applied,when there is no residual for the target block for processing, thepredicted block may be used as the reconstructed block. The adder 155may be denoted a reconstructor or reconstructed block generator. Thegenerated reconstructed signal may be used for intra prediction of thenext target processing block in the current picture and, as describedbelow, be filtered and then used for inter prediction of the nextpicture.

The filter 160 may enhance the subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter160 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and transmit the modifiedreconstructed picture to the decoding picture buffer 170. The variousfiltering methods may include, e.g., deblocking filtering, sampleadaptive offset, adaptive loop filter, or bilateral filter. The filter160 may generate various pieces of information for filtering andtransfer the resultant information to the entropy encoder 190 asdescribed below in connection with each filtering method. Thefiltering-related information may be encoded by the entropy encoder 190and be output in the form of a bitstream.

The modified reconstructed picture transmitted to the decoding picturebuffer 170 may be used as the reference picture in the inter predictor180. The encoding device 100, when inter prediction is applied thereby,may avoid a prediction mismatch between the encoding device 100 and thedecoding device and enhance coding efficiency.

The decoding picture buffer 170 may store the modified reconstructedpicture for use as the reference picture in the inter predictor 180.

FIG. 2 is a block diagram schematically illustrating a decoding deviceto decode image signals according to an embodiment of the disclosure.

Referring to FIG. 2, a decoding device 200 may include an entropydecoder 210, an inverse quantizer 220, an inverse transformer 230, anadder 235, a filter 240, a decoding picture buffer 250, an interpredictor 260, and an intra predictor 265. The inter predictor 260 andthe intra predictor 265 may be collectively referred to as a predictor.In other words, the predictor may include the inter predictor 180 andthe intra predictor 185. The inverse quantizer 220 and the inversetransformer 230 may be collectively referred to as a residual processor.In other words, the residual processor may include the inverse quantizer220 and the inverse transformer 230. The entropy decoder 210, theinverse quantizer 220, the inverse transformer 230, the adder 235, thefilter 240, the inter predictor 260, and the intra predictor 265 may beconfigured in a single hardware component (e.g., a decoder or processor)according to an embodiment. The decoding picture buffer 250 may beimplemented as a single hardware component (e.g., a memory or digitalstorage medium) according to an embodiment.

When a bitstream including video/image information is input, thedecoding device 200 may reconstruct the image corresponding to thevideo/image information process in the encoding device 100 of FIG. 2.For example, the decoding device 200 may perform decoding using theprocessing unit applied in the encoding device 100. Thus, upon decoding,the processing unit may be, e.g., a coding unit, and the coding unit maybe split from the coding tree unit or largest coding unit, according tothe quad tree structure and/or binary tree structure. The reconstructedimage signal decoded and output through the decoding device 200 may beplayed via a player.

The decoding device 200 may receive the signal output from the encodingdevice 100 of FIG. 2, in the form of a bitstream, and the receivedsignal may be decoded via the entropy decoder 210. For example, theentropy decoder 210 may parse the bitstream and extract information(e.g., video/image information) necessary for image reconstruction (orpicture reconstruction). For example, the entropy decoder 210 may decodethe information in the bitstream based on a coding method, such asexponential Golomb encoding, CAVLC, or CABAC and may output the valuesof syntax elements necessary for image reconstruction and quantizedvalues of transform coefficients regarding the residual. Specifically,the CABAC entropy decoding method may receive a bin corresponding toeach syntax element in the bitstream, determine a context model usingdecoding target syntax element information, decoding information forneighboring and decoding target block, or information for the symbol/bindecoded in the prior step, predict the probability of occurrence of abin according to the determined context model, and performing thearithmetic decoding of the bin. At this time, after determining thecontext model, the CABAC entropy decoding method may update the contextmodel using information for the symbol/bin decoded for the context modelof the next symbol/bin. Among the pieces of information decoded by theentropy decoder 210, information for prediction may be provided to thepredictor (e.g., the inter predictor 260 and intra predictor 265), andthe residual value entropy-decoded by the entropy decoder 210, i.e., thequantized transform coefficients and relevant processor information, maybe input to the inverse quantizer 220. Among the pieces of informationdecoded by the entropy decoder 210, information for filtering may beprovided to the filter 240. Meanwhile, a receiver (not shown) forreceiving the signal output from the encoding device 100 may further beconfigured as an internal/external element of the decoding device 200,or the receiver may be a component of the entropy decoder 210.

The inverse quantizer 220 may inverse-quantize the quantized transformcoefficients and output the transform coefficients. The inversequantizer 220 may re-sort the quantized transform coefficients in theform of a two-dimensional block. In this case, the re-sorting may beperformed based on the coefficient scan order in which the encodingdevice 100 has performed. The inverse quantizer 220 may inverse-quantizethe quantized transform coefficients using quantization parameters(e.g., quantization step size information), obtaining transformcoefficients.

The inverse transformer 230 obtains the residual signal (residual blockor residual sample array) by inverse-transforming the transformcoefficients.

The predictor may perform prediction on the current block and generate apredicted block including prediction samples for the current block. Thepredictor may determine which one of intra prediction or interprediction is applied to the current block based on information forprediction output from the entropy decoder 210 and determine a specificintra/inter prediction mode.

The intra predictor 265 may predict the current block by referencing thesamples in the current picture. The referenced samples may neighbor, orbe positioned away from, the current block depending on the predictionmode. In the intra prediction, the prediction modes may include aplurality of non-directional modes and a plurality of directional modes.The intra predictor 265 may determine the prediction mode applied to thecurrent block using the prediction mode applied to the neighboringblock.

The inter predictor 260 may derive a predicted block for the currentblock, based on a reference block (reference sample array) specified bya motion vector on the reference picture. Here, to reduce the amount ofmotion information transmitted in the inter prediction mode, the motioninformation may be predicted per block, subblock, or sample based on thecorrelation in motion information between the neighboring block and thecurrent block. The motion information may include the motion vector anda reference picture index. The motion information may further includeinter prediction direction (L0 prediction, L1 prediction, or Biprediction) information. In the case of inter prediction, neighboringblocks may include a spatial neighboring block present in the currentpicture and a temporal neighboring block present in the referencepicture. For example, the inter predictor 260 may construct a motioninformation candidate list based information related to prediction of onthe neighboring blocks and derive the motion vector and/or referencepicture index of the current block based on the received candidateselection information. Inter prediction may be performed based onvarious prediction modes. The information for prediction may includeinformation indicating the mode of inter prediction for the currentblock.

The adder 235 may add the obtained residual signal to the predictionsignal (e.g., predicted block or prediction sample array) output fromthe inter predictor 260 or intra predictor 265, thereby generating thereconstructed signal (reconstructed picture, reconstructed block, orreconstructed sample array). As in the case where skip mode is applied,when there is no residual for the target block for processing, thepredicted block may be used as the reconstructed block.

The adder 235 may be denoted a reconstructor or reconstructed blockgenerator. The generated reconstructed signal may be used for intraprediction of the next target processing block in the current pictureand, as described below, be filtered and then used for inter predictionof the next picture.

The filter 240 may enhance the subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter240 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and transmit the modifiedreconstructed picture to the decoding picture buffer 250. The variousfiltering methods may include, e.g., deblocking filtering, sampleadaptive offset (SAO), adaptive loop filter (ALF), or bilateral filter.

The modified reconstructed picture transmitted to the decoding picturebuffer 250 may be used as the reference picture by the inter predictor260.

In the disclosure, the embodiments described above in connection withthe filter 160, the inter predictor 180, and the intra predictor 185 ofthe encoding device 100 may be applied, in the same way as, or tocorrespond to, the filter 240, the inter predictor 260, and the intrapredictor 265 of the decoding device 200.

FIGS. 3A, 3B, 3C, and 3D are views illustrating block split structuresby quad tree (QT), binary tree (BT), ternary tree (TT), and asymmetrictree (AT), respectively, according to embodiments of the disclosure.

In video coding, one block may be split based on the QT. One subblocksplit into by the QT may further be split recursively by the QT. Theleaf block which is not any longer split by the QT may be split by atleast one scheme of the BT, TT, or AT. The BT may have two types ofsplitting, such as horizontal BT (2N×N, 2N×N) and vertical BT (N×2N,N×2N). The TT may have two types of splitting, such as horizontal TT(2N×1/2N, 2N×N, 2N×1/2N) and vertical TT (½N×2N, N×2N, ½N×2N). The ATmay have four types of splitting, such as horizontal-up AT (2N×1/2N,2N×3/2N), horizontal-down AT (2N×3/2N, 2N×1/2N), vertical-left AT(½N×2N, 3/2N×2N), and vertical-right AT (3/2N×2N, ½N×2N). The BT, TT,and AT each may be further split recursively using the BT, TT, and AT.

FIG. 3A shows an example of QT splitting. Block A may be split into foursubblocks (A0, A1, A2, A3) by the QT. Subblock A1 may be split againinto four subblocks (B0, B1, B2, B3) by the QT.

FIG. 3B shows an example of BT splitting. Block B3, which is not anylonger split by the QT, may be split into vertical BT(C0, C1) orhorizontal BT(D0, D1). Like block C0, each subblock may be further splitrecursively, e.g., in the form of horizontal BT(E0, E1) or vertical BT(F0, F1).

FIG. 3C shows an example of TT splitting. Block B3, which is not anylonger split by the QT, may be split into vertical TT(C0, C1, C2) orhorizontal TT(D0, D1, D2). Like block C1, each subblock may be furthersplit recursively, e.g., in the form of horizontal TT′(E0, E1, E2) orvertical TT (F0, F1, F2).

FIG. 3D shows an example of AT splitting. Block B3, which is not anylonger split by the QT, may be split into vertical AT(C0, C1) orhorizontal AT(D0, D1). Like block C1, each subblock may be further splitrecursively, e.g., in the form of horizontal AT(E0, E1) or vertical TT(F0, F1).

Meanwhile, the BT, TT, and AT may be used together. For example, thesubblock split by the BT may be split by the TT or AT. Further, thesubblock split by the TT may be split by the BT or AT. The subblocksplit by the AT may be split by the BT or TT. For example, after splitby the horizontal BT, each subblock may be split by the vertical BT or,after split by the vertical BT, each subblock may be split by thehorizontal BT. In this case, although different splitting orders areapplied, the final shape after split may be identical.

When a block is split, various orders of searching for the block may bedefined. Generally, a search is performed from the left to right or fromthe top to bottom. Searching for a block may mean the order ofdetermining whether to further split each subblock split into or, if theblock is not split any longer, the order of encoding each subblock, orthe order of search when the subblock references other neighboringblock.

A transform may be performed per processing unit (or transform block)split by the splitting structure as shown in FIG. 3A to 3D. Inparticular, it may be split per the row direction and column direction,and a transform matrix may apply. According to an embodiment of thedisclosure, other types of transform may be used along the row directionor column direction of the processing unit (or transform block).

FIGS. 4 and 5 are the embodiments to which the disclosure is applied.FIG. 4 is a block diagram schematically illustrating the encoding device100 of FIG. 1, which includes a transform and quantization unit 120/130,according to an embodiment of the disclosure and FIG. 5 is a blockdiagram schematically illustrating a decoding device 200 including aninverse-quantization and inverse-transform unit 220/230 according to anembodiment of the disclosure.

Referring to FIG. 4, the transform and quantization unit 120/130 mayinclude a primary transform unit 121, a secondary transform unit 122,and a quantizer 130. The inverse quantization and inverse transform unit140/150 may include an inverse quantizer 140, an inverse secondarytransform unit 151, and an inverse primary transform unit 152.

Referring to FIG. 5, the inverse quantization and inverse transform unit220/230 may include an inverse quantizer 220, an inverse secondarytransform unit 231, and an inverse primary transform unit 232.

In the disclosure, transform may be performed through a plurality ofsteps. For example, as shown in FIG. 4, two steps of primary transformand secondary transform may be applied, or more transform steps may beapplied depending on the algorithm. Here, the primary transform may bereferred to as a core transform.

The primary transform unit 121 may apply primary transform to theresidual signal. Here, the primary transform may be previously definedas a table in the encoder and/or decoder.

The secondary transform unit 122 may apply secondary transform to theprimary transformed signal. Here, the secondary transform may bepreviously defined as a table in the encoder and/or decoder.

According to an embodiment, a non-separable secondary transform (NSST)may be conditionally applied as the secondary transform. For example,the NSST may be applied only to intra prediction blocks and may have atransform set applicable to each prediction mode group.

Here, the prediction mode group may be set based on the symmetry for theprediction direction. For example, since prediction mode 52 andprediction mode 16 are symmetrical with respect to prediction mode 34(diagonal direction), they may form one group and the same transform setmay be applied thereto. Upon applying transform for the prediction mode52, after input data is transposed, the transform is applied to thetransposed input data and this is because the transform set of theprediction mode 52 is same as that of the prediction mode 16.

Meanwhile, since the planar mode and DC mode lack directional symmetry,they have their respective transform sets, and each transform set mayconsist of two transforms. For the other directional modes, eachtransform set may consist of three transforms.

The quantizer 130 may perform quantization on the secondary-transformedsignal.

The inverse quantization and inverse transform unit 140/150 mayinversely perform the above-described process, and no duplicatedescription is given.

FIG. 5 is a block diagram schematically illustrating the inversequantization and inverse transform unit 220/230 in the decoding device200.

Referring to FIG. 5, the inverse quantization and inverse transform unit220/230 may include an inverse quantizer 220, an inverse secondarytransform unit 231, and an inverse primary transform unit 232.

The inverse quantizer 220 obtains transform coefficients from theentropy-decoded signal using quantization step size information.

The inverse secondary transform unit 231 performs an inverse secondarytransform on the transform coefficients. Here, the inverse secondarytransform represents an inverse transform of the secondary transformdescribed above in connection with FIG. 4.

The inverse primary transform unit 232 performs an inverse primarytransform on the inverse secondary-transformed signal (or block) andobtains the residual signal. Here, the inverse primary transformrepresents an inverse transform of the primary transform described abovein connection with FIG. 4.

FIG. 6 is a flowchart illustrating an example of encoding a video signalvia primary transform and secondary transform according to an embodimentof the disclosure. The operations of FIG. 6 may be performed by thetransformer 120 of the encoding device 100.

The encoding device 100 may determine (or select) a forward secondarytransform based on at least one of the prediction mode, block shape,and/or block size of a current block (S610).

The encoding device 100 may determine the optimal forward secondarytransform via rate-distortion (RD) optimization. The optimal forwardsecondary transform may correspond to one of a plurality of transformcombinations, and the plurality of transform combinations may be definedby a transform index. For example, for the RD optimization, the encodingdevice 100 may compare all of the results of performing forwardsecondary transform, quantization, and residual coding for respectivecandidates.

The encoding device 100 may signal a second transform indexcorresponding to the optimal forward secondary transform (S620). Here,other embodiments described in the disclosure may may be applied to thesecondary transform index.

Meanwhile, the encoding device 100 may perform a forward primary scan onthe current block (residual block) (S630).

The encoding device 100 may perform a forward secondary transform on thecurrent block using the optimal forward secondary transform (S640).Meanwhile, the forward secondary transform may be the RST describedbelow. RST means a transform by which N pieces of residual data (N×1residual vectors) are input, and R (R<N) pieces of transform coefficientdata (R×1 transform coefficient vectors) are output.

According to an embodiment, the RST may be applied to a specific area ofthe current block. For example, when the current block is N×N, thespecific area may mean the top-left N/2×N/2 area. However, thedisclosure is not limited thereto, and the specific area may be set todiffer depending on at least one of the prediction mode, block shape, orblock size. For example, when the current block is N×N, the specificarea may mean the top-left M×M area (M≥N).

Meanwhile, the encoding device 100 may perform quantization on thecurrent block, thereby generating a transform coefficient block (S650).

The encoding device 100 may perform entropy encoding on the transformcoefficient block, thereby generating a bitstream.

FIG. 7 is a flowchart illustrating an example of decoding a video signalvia secondary inverse-transform and primary inverse-transform accordingto an embodiment of the disclosure. The operations of FIG. 7 may beperformed by the inverse transformer 230 of the decoding device 200.

The decoding device 200 may obtain the secondary transform index fromthe bitstream.

The decoding device 200 may induce secondary transform corresponding tothe secondary transform index.

However, steps S710 and S720 amount to a mere embodiment, and thedisclosure is not limited thereto. For example, the decoding device 200may induce the secondary transform based on at least one of theprediction mode, block shape, and/or block size of the current block,without obtaining the secondary transform index.

Meanwhile, the decoder 200 may obtain the transform coefficient block byentropy-decoding the bitstream and may perform inverse quantization onthe transform coefficient block (S730).

The decoder 200 may perform inverse secondary transform on theinverse-quantized transform coefficient block (S740). For example, theinverse secondary transform may be the inverse RST. The inverse RST isthe transposed matrix of the RST described above in connection with FIG.6 and means a transform by which R pieces of transform coefficient data(R×1 transform coefficient vectors) are input, and N pieces of residualdata (N×1 residual vectors) are output.

According to an embodiment, reduced secondary transform may be appliedto a specific area of the current block. For example, when the currentblock is N×N, the specific area may mean the top-left N/2×N/2 area.However, the disclosure is not limited thereto, and the specific areamay be set to differ depending on at least one of the prediction mode,block shape, or block size. For example, when the current block is N×N,the specific area may mean the top-left M×M area (M≥N) or M×L (M≥N,L≥N).

The decoder 200 may perform inverse primary transform on the result ofthe inverse secondary transform (S750).

The decoder 200 generates a residual block via step S750 and generates areconstructed block by adding the residual block and a prediction block.

FIG. 8 illustrates an example transform configuration group to whichadaptive multiple transform (AMT) applies, according to an embodiment ofthe disclosure.

Referring to FIG. 8, the transform configuration group may be determinedbased on the prediction mode, and there may be a total of six (G0 to G5)groups. G0 to G4 correspond to the case where intra prediction applies,and G5 represents transform combinations (or transform set or transformcombination set) applied to the residual block generated by interprediction.

One transform combination may consist of the horizontal transform (orrow transform) applied to the rows of a two-dimensional block and thevertical transform (or column transform) applied to the columns of thetwo-dimensional block.

Here, each transform configuration group may include four transformcombination candidates. The four transform combination candidates may beselected or determined via the transform combination indexes of 0 to 3,and the transform combination indexes may be transmitted from theencoding device 100 to the decoding device 200 via an encodingprocedure.

According to an embodiment, the residual data (or residual signal)obtained via intra prediction may have different statistical featuresdepending on intra prediction modes. Thus, transforms other than theregular cosine transform may be applied per prediction mode as shown inFIG. 8. The transform type may be represented herein as DCT-Type 2,DCT-11, or DCT-2.

FIG. 8 illustrates the respective transform set configurations of when35 intra prediction modes are used and when 67 intra prediction modesare used. A plurality of transform combinations may apply per transformconfiguration group differentiated in the intra prediction mode columns.For example, the plurality of transform combinations (transforms alongthe row direction, transforms along the column direction) may consist offour combinations. More specifically, since in group 0 DST-7 and DCT-5may applied to both the row (horizontal) direction and column (vertical)direction, four combinations are possible.

Since a total of four transform kernel combinations may apply to eachintra prediction mode, the transform combination index for selecting oneof them may be transmitted per transform unit. In the disclosure, thetransform combination index may be denoted an AMT index and may berepresented as amt_idx.

In kernels other than the one proposed in FIG. 8, there is the occasionthat DCT-2 is optimal to both the row direction and column direction bythe nature of the residual signal. Thus, transform may be adaptivelyperformed by defining an AMT flag per coding unit. Here, if the AMT flagis 0, DCT-2 may be applied to both the row direction and columndirection and, if the AMT flag is 1, one of the four combinations may beselected or determined via the AMT index.

According to an embodiment, in a case where the AMT flag is 0, if thenumber of transform coefficients is 3 or less for one transform unit,the transform kernels of FIG. 8 are not applied, and DST-7 may beapplied to both the row direction and column direction.

According to an embodiment, the transform coefficient values are firstparsed and, if the number of transform coefficients is 3 or less, theAMT index is not parsed, and DST-7 may be applied, thereby reducing thetransmissions of additional information.

According to an embodiment, the AMT may apply only when the width andheight of the transform unit, both, are 32 or less.

According to an embodiment, FIG. 8 may be previously set via off-linetraining.

According to an embodiment, the AMT index may be defined with one indexthat may simultaneously indicate the combination of horizontal transformand vertical transform. Or, the AMT index may be separately defined witha horizontal transform index and a vertical transform index.

Like the above-described AMT, a scheme of applying a transform selectedfrom among the plurality of kernels (e.g., DCT-2, DST-7, and DCT-8) maybe denoted as multiple transform selection (MTS) or enhanced multipletransform (EMT), and the AMT index may be denoted as an MTS index.

FIG. 9 is a flowchart illustrating encoding to which AMT is appliedaccording to an embodiment of the disclosure. The operations of FIG. 9may be performed by the transformer 120 of the encoding device 100.

Although the disclosure basically describes applying transformseparately for the horizontal direction and vertical direction, atransform combination may be constituted of non-separable transforms.

Or, separable transforms and non-separable transforms may be mixed. Inthis case, if a non-separable transform is used, transform selection perrow/column direction or selection per horizontal/vertical direction isunnecessary and, only when a separable transform is selected, thetransform combinations of FIG. 8 may come into use.

Further, the schemes proposed in the disclosure may be appliedregardless of whether it is the primary transform or secondarytransform. In other words, there is no such a limitation that eithershould be applied but both may rather be applied. Here, primarytransform may mean transform for first transforming the residual block,and secondary transform may mean transform applied to the blockresultant from the primary transform.

First, the encoding device 100 may determine a transform configurationgroup corresponding to a current block (S910). Here, the transformconfiguration group may be constituted of the combinations as shown inFIG. 8.

The encoding device 100 may perform transform on candidate transformcombinations available in the transform configuration group (S920).

As a result of performing the transform, the encoding device 100 maydetermine or select a transform combination with the smallest ratedistortion (RD) cost (S930).

The encoding device 100 may encode a transform combination indexcorresponding to the selected transform combination (S940).

FIG. 10 is a flowchart illustrating decoding to which AMT is appliedaccording to an embodiment of the disclosure. The operations of FIG. 10may be performed by the inverse transformer 230 of the decoding device200.

First, the decoding device 200 may determine a transform configurationgroup for a current block (S1010). The decoding device 200 may parse (orobtain) the transform combination index from the video signal, whereinthe transform combination index may correspond to any one of theplurality of transform combinations in the transform configuration group(S1020). For example, the transform configuration group may includeDCT-2, DST-7, or DCT-8.

The decoding device 200 may induce the transform combinationcorresponding to the transform combination index (S1030). Here, thetransform combination may consist of the horizontal transform andvertical transform and may include at least one of DCT-2, DST-7, orDCT-8. Further, as the transform combination, the transform combinationdescribed above in connection with FIG. 8 may be used.

The decoding device 200 may perform inverse transform on the currentblock based on the induced transform combination (S1040). Where thetransform combination consists of row (horizontal) transform and column(vertical) transform, the row (horizontal) transform may be appliedfirst and, then, the column (vertical) transform may apply. However, thedisclosure is not limited thereto, and its opposite way may be appliedor, if consisting of only non-separable transforms, non-separabletransform may immediately be applied.

According to an embodiment, if the vertical transform or horizontaltransform is DST-7 or DCT-8, the inverse transform of DST-7 or theinverse transform of DCT-8 may be applied per column and then per row.Further, in the vertical transform or horizontal transform, differenttransform may apply per row and/or per column.

According to an embodiment, the transform combination index may beobtained based on the AMT flag indicating whether the AMT is performed.In other words, the transform combination index may be obtained onlywhen the AMT is performed according to the AMT flag. Further, thedecoding device 200 may identify whether the number of non-zerotransform coefficients is larger than a threshold. At this time, thetransform combination index may be parsed only when the number ofnon-zero transform coefficients is larger than the threshold.

According to an embodiment, the AMT flag or AMT index may be defined atthe level of at least one of sequence, picture, slice, block, codingunit, transform unit, or prediction unit.

Meanwhile, according to another embodiment, the process of determiningthe transform configuration group and the step of parsing the transformcombination index may simultaneously be performed. Or, step S1010 may bepreset in the encoding device 100 and/or decoding device 200 and beomitted.

FIG. 11 is a flowchart illustrating an example of encoding an AMT flagand an AMT index according to an embodiment of the disclosure. Theoperations of FIG. 11 may be performed by the transformer 120 of theencoding device 100.

The encoding device 100 may determine whether the AMT is applied to acurrent block (S1110).

If the AMT is applied, the encoding device 100 may perform encoding withAMT flag=1 (S1120).

The encoding device 100 may determine the AMT index based on at leastone of the prediction mode, horizontal transform, or vertical transformof the current block (S1130). Here, the AMT index denotes an indexindicating any one of the plurality of transform combinations for eachintra prediction mode, and the AMT index may be transmitted pertransform unit.

When the AMT index is determined, the encoding device 100 may encode theAMT index (S1140).

On the other hand, unless the AMT is applied, the encoding device 100may perform encoding with AMT flag=0 (S1150).

FIG. 12 is a flowchart illustrating decoding for performing transformbased on an AMT flag and an AMT index.

The decoding device 200 may parse the AMT flag from the bitstream(S1210). Here, the AMT flag may indicate whether the AMT is applied to acurrent block.

The decoding device 200 may identify whether the AMT is applied to thecurrent block based on the AMT flag (S1220). For example, the decodingdevice 200 may identify whether the AMT flag is 1.

If the AMT flag is 1, the decoding device 200 may parse the AMT index(S1230). Here, the AMT index denotes an index indicating any one of theplurality of transform combinations for each intra prediction mode, andthe AMT index may be transmitted per transform unit. Or, the AMT indexmay mean an index indicating any one transform combination defined in apreset transform combination table. The preset transform combinationtable may mean FIG. 8, but the disclosure is not limited thereto.

The decoding device 200 may induce or determine horizontal transform andvertical transform based on at least one of the AMT index or predictionmode (S1240).

Or, the decoding device 200 may induce the transform combinationcorresponding to the AMT index. For example, the decoding device 200 mayinduce or determine the horizontal transform and vertical transformcorresponding to the AMT index.

Meanwhile, if the AMT flag is 0, the decoding device 200 may applypreset vertical inverse transform per column (S1250). For example, thevertical inverse transform may be the inverse transform of DCT-2.

The decoding device 200 may apply preset horizontal inverse transformper row (S1260). For example, the horizontal inverse transform may bethe inverse transform of DCT-2. That is, when the AMT flag is 0, apreset transform kernel may be used in the encoding device 100 ordecoding device 200. For example, rather than one defined in thetransform combination table as shown in FIG. 8, a transform kernelwidely in use may be used.

NSST (Non-Separable Secondary Transform)

Secondary transform denotes applying a transform kernel once again,using the result of application of primary transform as an input. Theprimary transform may include DCT-2 or DST-7 in the HEVC or theabove-described AMT. Non-separable transform denotes, after regardingN×N two-dimension residual block as N²×1 vector, applying N²×N²transform kernel to the N²×1 vector only once, rather than sequentiallyapplying a N×N transform kernel to the row direction and columndirection.

That is, the NSST may denote a non-separable square matrix applied tothe vector consisting of the coefficients of a transform block. Further,although the description of the embodiments of the disclosure focuses onthe NSST as an example of non-separable transform applied to thetop-left area (low-frequency area) determined according to a block size,the embodiment of the disclosure are not limited to the term “NSST” butany types of non-separable transforms may rather be applied to theembodiments of the disclosure. For example, the non-separable transformapplied to the top-left area (low-frequency area) determined accordingto the block size may be denoted as low frequency non-separabletransform (LFNST). In the disclosure, M×N transform (or transformmatrix) means a matrix consisting of M rows and N columns.

In the NSST, the two-dimension block data obtained by applying primarytransform is split into M×M blocks, and then, M²×M² non-separabletransform is applied to each M×M block. M may be, e.g., 4 or 8. Ratherthan applying the NSST to all the areas in the two-dimension blockobtained by the primary transform, the NSST may be applied to only someareas. For example, the NSST may be applied only to the top-left 8×8block. Further, the 64×64 non-separable transform may be applied to thetop-left 8×8 area only when the width and height of the two-dimensionblock obtained by the primary transform, both, are 8 or more, and therest may be split into 4× blocks and the 16×16 non-separable transformmay be applied to each of the 4×4 blocks.

The M²×M² non-separable transform may be applied in the form of thematrix product, but, for reducing computation loads and memoryrequirements, be approximated to combinations of Givens rotation layersand permutation layers. FIG. 13 illustrates one Givens rotation. Asshown in FIG. 13, it may be described with one angle of one Givensrotation.

FIG. 13 is a diagram illustrating Givens rotation according to anembodiment of the disclosure, and FIG. 14 illustrates a configuration ofone round in a 4×4 NSST constituted of permutations and a Givensrotation layer according to an embodiment of the disclosure.

8×8 NSST and 4×4 NSST both may be configured of a hierarchicalcombination of Givens rotations. The matrix corresponding to one Givensrotation is as shown in Equation 1, and the matrix product may beexpressed in diagram as shown in FIG. 13.

$\begin{matrix}{R_{\theta} = \begin{bmatrix}{\cos\;\theta} & {{- \sin}\;\theta} \\{\sin\;\theta} & {\cos\;\theta}\end{bmatrix}} & \left\lbrack {{Equation}\mspace{14mu} 1} \right\rbrack \\{{t_{m} = {{x_{m}\cos\;\theta} - {x_{n}\sin\;\theta}}}{t_{n} = {{x_{m}\sin\;\theta} + {x_{n}\cos\;\theta}}}} & \left\lbrack {{Equation}\mspace{14mu} 2} \right\rbrack\end{matrix}$

Since one Givens rotation rotates two pieces of data as shown in FIG.13, 32 or 8 Givens rotations are needed to process 64 pieces of data (inthe case of 8×8 NSST) or 16 pieces of data (in the case of 4×4 NSST),respectively. Thus, a bundle of 32 or 8 Givens rotations may form aGivens rotation layer. As shown in FIG. 14, output data for one Givensrotation layer is transferred as input data for the next Givens rotationlayer through permotation (or shuffling). As shown in FIG. 14, thepermutation pattern is regularly defined and, in the case of 4×4 NSST,four Givens rotation layers and their corresponding permutations formone round. 4×4 NSST is performed by two rounds, and 8×8 NSST isperformed by four rounds. Although different rounds use the samepermutation pattern, different Givens rotation angles are applied. Thus,it is needed to store the angle data for all the Givens rotationsconstituting each transform.

In the last step, final one more permutation is performed on the dataoutput via the Givens rotation layers, and information for thepermutation is separately stored per transform. The permutation isperformed at the end of the forward NSST, and the inverse permutation isfirst applied to the inverse NSST.

The inverse NSST performs, in inverse order, the Givens rotation layersand the permutations applied to the forward NSST and takes a minus (−)value to the angle of each Givens rotation to rotate.

FIG. 15 illustrates an example configuration of non-split transform setper intra prediction mode according to an embodiment of the disclosure.

Intra prediction modes to which the same NSST or NSST set is applied myform a group. In FIG. 15, 67 intra prediction modes are classified into35 groups. For example, the number 20 mode and the number 48 mode bothbelong to the number 20 group (hereinafter, mode group).

Per mode group, a plurality of NSSTs, rather than one NSST, may beconfigured into a set. Each set may include the case where no NSST isapplied. For example, where three different NSSTs may be applied to onemode group, one of the four cases including the case where no NSST isapplied may be selected. At this time, the index for differentiating oneamong the four cases may be transmitted in each TU. The number of NSSTsmay be configured to differ per mode group. For example, the number 0mode group and the number 1 mode group may be respectively signaled toselect one of three cases including the case where no NSST is applied.

Embodiment 1: RST Applicable to 4×4 Blocks

The non-separable transform applicable to one 4×4 block is 16×16transform. That is, if the data elements constituting the 4×4 block aresorted in a row in the row-first or column-first order, it becomes a16×1 vector, and the non-separable transform may be applied to the 16×1vector. The forward 16×16 transform consists of 16 row-directiontransform basis vectors, and the inner product of the 16×1 vector andeach transform basis vector leads to the transform coefficient for thetransform basis vector. The process of obtaining the transformcoefficients for all of the 16 transform basis vectors is to multiplythe 16×16 non-separable transform matrix by the input 16×1 vector. Thetransform coefficients obtained by the matrix product have the form of a16×1 vector, and the statistical characteristics may differ pertransform coefficient. For example, if the 16×1 transform coefficientvector consists of the zeroth element to the 15th element, the varianceof the zeroth element may be larger than the variance of the 15thelement. That is, the more ahead the element is positioned, the largervariance the element has and thus a larger energy value.

If inverse 16×16 non-separable transform is applied from the 16×1transform coefficient vector (when the effects of quantization orintegerization are disregarded), the original 4×4 block signal may bereconstructed. If the forward 16×16 non-separable transform is anorthogonal transform, the inverse 16×16 transform may be obtained bytransposing the matrix for the forward 16×16 transform. Simply speaking,data in the form of a 16×1 vector may be obtained by multiplying theinverse 16×16 non-separable transform matrix by the 16×1 transformcoefficient vector and, if sorted in the row-first or column-first orderas first applied, the 4×4 block signal may be reconstructed.

As set forth above, the elements of the 16×1 transform coefficientvector each may have different statistical characteristics. As in theabove-described example, if the transform coefficients positioned ahead(close to the zeroth element) have larger energy, a signal significantlyclose to the original signal may be reconstructed by applying an inversetransform to some transform coefficients first appearing, even withoutthe need for using all of the transform coefficients. For example, whenthe inverse 16×16 non-separable transform consists of 16 column basisvectors, only L column basis vectors are left to configure a 16×Lmatrix, and among the transform coefficients, only L transformcoefficients which are more important are left (L×1 vector, this mayfirst appear in the above-described example), and then the 16×L matrixand the L×1 vector are multiplied, thereby enabling reconstruction ofthe 16×1 vector which is not large in difference from the original 16×1vector data. Resultantly, only L coefficients involve the datareconstruction. Thus, upon obtaining the transform coefficient, it isenough to obtain the L×1 transform coefficient vector, not the 16×1transform coefficient vector. That is, L row direction transform vectorsare picked from the forward 16×16 non-separable transform matrix toconfigure the L×16 transform, and is then multiplied with the 16×1 inputvector, thereby obtaining the L main transform coefficients.

Embodiment 2: Configuring Application Area of 4×4 RST and Arrangement ofTransform Coefficients

4×4 RST may be applied as the two-dimension transform and, at this time,may be secondarily applied to the block to which the primary transform,such as DCT-type 2, has been applied. When the size of the primarytransform-applied block is N×N, it is typically larger than 4×4. Thus,the following two methods may be considered upon applying 4×4 RST to theN×N block.

4×4 RST may be applied to some areas of N×N area, rather than all theN×N area. For example, 4×4 RST may be applied only to the top-left M×Marea (M<=N).

The area to which the secondary transform is to be applied may be splitinto 4×4 blocks, and 4×4 RST may be applied to each block.

Methods 1) and 2) may be mixed. For example, only the top-left M×M areamay be split into 4×4 blocks and then 4×4 RST may be applied.

In a specific embodiment, the secondary transform may be applied only tothe top-left 8×8 area. If the N×N block is equal to or larger than 8×8,8×8 RS may be applied and, if the N×N block is smaller than 8×8 (4×4,8×4, or 4×8), it may be split into 4×4 blocks and 4×4 RST may then beapplied as in 2) above.

If L transform coefficients (1<=L<16) are generated after 4×4 RST isapplied, a freedom arises as to how to arrange the L transformcoefficients. However, since there may be a determined order uponreading and processing the transform coefficients in the residual codingpart, coding performance may be varied depending on how to arrange the Ltransform coefficients in a two-dimensional block. In the highefficiency video coding (HEVC) standard, residual coding starts from theposition farthest from the DC position, and this is for raising codingperformance by using the fact that as positioned farther from the DCposition, the coefficient value that has undergone quantization is 0 orclose to 0. Thus, it may be advantageous in view of coding performanceto place the coefficients of more critical and higher-energy out of theL transform coefficients later in a coding order.

FIG. 16 illustrates three forward scan orders on transform coefficientsor a transform coefficient block applied in the HEVC standard, wherein(a) illustrates a diagonal scan, (b) illustrates a horizontal scan, and(c) illustrates a vertical scan.

FIG. 16 illustrates three forward scan orders for transform coefficientsor a transform coefficient block (4×4 block, coefficient group (CG))applied in the HEVC standard. Residual coding is performed in theinverse order of the scan order of (a), (b), or (c) (i.e., coded in theorder from 16 to 1). The three scan orders shown in (a), (b), and (c)are selected according to the intra prediction mode. Thus, likewise forthe L transform coefficients, the scan order may be determined accordingto the intra prediction mode.

L is subject to the range 1<=L<16. Generally, L transform basis vectorsmay be selected from 16 transform basis vectors by any method. However,it may be advantageous in view of encoding efficiency to selecttransform basis vectors with higher importance in energy aspect as inthe above-proposed example in light of encoding and decoding.

FIG. 17 illustrates the position of the transform coefficients in a casea forward diagonal scan is applied when 4×4 RST is applied to a 4×8block, according to an embodiment of the disclosure, and FIG. 18illustrates an example of merging the valid transform coefficients oftwo 4×4 blocks into a single block according to an embodiment of thedisclosure.

If, upon splitting the top-left 4×8 block into 4×4 blocks according tothe diagonal scan order of (a) and applying 4×4 RST, L is 8 (i.e., ifamong the 16 transform coefficients, only eight transform coefficientsare left), the transform coefficients may be positioned as shown in FIG.17, where only half of each 4×4 block may have transform coefficients,and the positions marked with X may be filled with 0's as default. Thus,the L transform coefficients are arranged in each 4×4 block according tothe scan order proposed in (a) and, under the assumption that theremaining (16-L) positions of each 4×4 block are filled with 0's, theresidual coding (e.g., residual coding in HEVC) may be applied.

Further, the L transform coefficients which have been arranged in two4×4 blocks as shown in FIG. 18 may be configured in one block. Inparticular, since one 4×4 block is fully filled with the transformcoefficients of the two 4×4 blocks when L is 8, no transformcoefficients are left in other blocks. Thus, since residual coding isnot needed for the transform coefficient-empty 4×4 block, in the case ofHEVC, the flag (coded_sub_block_flag) indicating whether residual codingis applied to the block may be coded with 0. There may be variousschemes of combining the positions of the transform coefficients of thetwo 4×4 blocks. For example, the positions may be combined according toany order, and the following method may apply as well.

1) The transform coefficients of the two 4×4 blocks are combinedalternately in scan order. That is, when the transform coefficient forthe upper block is c₀ ^(u), c₁ ^(u), c₂ ^(u), c₃ ^(u), c₄ ^(u), c₅ ^(u),c₆ ^(u), c₇ ^(u), and the transform coefficient of the lower block is c₀^(l), c₁ ^(l), c₂ ^(l), c₃ ^(l), c₄ ^(l), c₅ ^(l), c₆ ^(l), c₇ ^(l),they may be combined alternately one by one like c₀ ^(u), c₀ ^(l), c₁^(u), c₁ ^(l), c₂ ^(u), c₂ ^(l), . . . , c₇ ^(u), c₇ ^(l). Further, c₈^(u) and c₈ ^(l), may be interchanged in order (i.e., c_(u) ^(l) maycome first).

2) The transform coefficients for the first 4×4 block may be arrangedfirst and, then, the transform coefficients for the second 4×4 block maybe arranged. That is, they may be connected and arranged like c₀ ^(u),c₁ ^(u), . . . , c₇ ^(u), c₀ ^(l), c₁ ^(l), . . . , c₇ ^(l). Of course,order may be changed like c₀ ^(l), c₁ ^(l), . . . , c₇ ^(l), c₀ ^(u), c₁^(u), . . . , c₇ ^(u).

Embodiment 3: Method of Coding NSST (Non-Separable Secondary Transform)Index for 4×4 RST

If 4×4 RST is applied as shown in FIG. 17, the L+1th position to the16th position may be filled with 0 according to the transformcoefficient scan order for each 4×4 block. Thus, if a non-zero value ispresent in the L+1th position to the 16th position in any one of the two4×4 blocks, it is inferred that 4×4 RST is not applied. If 4×4 RST hasthe structure of applying the transform selected from the transform setprepared like joint experiment model (JEM) NSST, an index as to whichtransform is to be applied may be signaled.

In some decoder, the NSST index may be known via bitstream parsing, andbitstream parsing may be performed after residual decoding. In thiscase, if a non-zero transform coefficient is rendered to exist betweenthe L+1th position and the 16th position by residual decoding, thedecoder may refrain from parsing the NSST index because it is certainthat 4×4 RST does not apply. Thus, signaling costs may be reduced byoptionally parsing the NSST index only when necessary.

If 4×4 RST is applied to the plurality of 4×4 blocks in a specific areaas shown in FIG. 17 (at this time, the same or different 4×4 RSTs mayapply), (the same or different) 4×4 RST(s) applied to all of the 4×4blocks may be designated via one NSST index. Since 4×4 RST, and whether4×4 RST is applied, are determined for all the 4×4 blocks by one NSSTindex, if as a result of inspecting whether there is a non-zerotransform coefficient in the L+1th position to the 16th position for allof the 4×4 blocks, a non-zero transform coefficient exists in anon-allowed position (the L+1th position to the 16th position) duringthe course of residual decoding, the encoding device 100 may beconfigured not to code the NSST index.

The encoding device 100 may separately signal the respective NSSTindexes for a luminance block and a chrominance block, and respectiveseparate NSST indexes may be signaled for the Cb component and the Crcomponent, and one common NSST index may be used in case of thechrominance block. Where one NSST index is used, signaling of the NSSTindex is also performed only once. Where one NSST index is shared forthe Cb component and the Cr component, the 4×4 RST indicated by the sameNSST index may be applied, and in this case the 4×4 RSTs for the Cbcomponent and the Cr component may be the same or, despite the same NSSTindex, individual 4×4 RSTs may be set for the Cb component and the Crcomponent. Where the NSST index shared for the Cb component and the Crcomponent is used, it is checked whether a non-zero transformcoefficient exists in the L+1th position to the sixth position for allof the 4×4 blocks of the Cb component and the Cr component and, if anon-zero transform coefficient is discovered in the L+1th position tothe 16th position, signaling for NSST index may be skipped.

Even when the transform coefficients for two 4×4 blocks are merged intoone 4×4 block as shown in FIG. 18, the encoding device 100 may check ifa non-zero transform coefficient appears in a position where no validtransform coefficient is to exist when 4×4 RST is applied and may thendetermine whether to signal the NSST index. In particular, where L is 8and, thus, upon applying 4×4 RST, no valid transform coefficients existin one 4×4 block as shown in FIG. 18 (the block marked with X in FIG.18(b)), the flag (coded_sub_block_flag) as to whether to apply residualcoding to the block may be checked and, if 1, the NSST index may not besignaled. As set forth above, although NSST is described below as anexample non-separable transform, other known terms (e.g., LFNST) may beused for the non-separable transform. For example, NSST set and NSSTindex may be interchangeably used with LFNS set and LFNS index,respectively. Further, RST as described herein is an example of thenon-separable transform (e.g., LFNST) that uses a non-square transformmatrix with a reduced output length and/or a reduced input length in thesquare non-separable transform matrix applied to at least some area ofthe transform block (the top-left 4×4, 8×8 area or the rest except thebottom-right 4×4 area in the 8×8 block) and may be interchangeably usedwith LFNST.

Embodiment 4: Optimization Method in Case where Coding on 4×4 Index isPerformed Before Residual Coding

Where coding for the NSST index is performed before residual coding,whether to apply 4×4 RST is previously determined. Thus, residual codingon the positions in which the transform coefficients are filled with 0'smay be omitted. Here, whether to apply 4×4 RST may be determined via theNSST index (e.g., if the NSST index is 0, 4×4 RST does not apply) and,otherwise, whether to apply 4×4 RST may be signaled via a separatesyntax element (e.g., NSST flag). For example, if the separate syntaxelement is the NSST flag, the decoding device 200 first parses the NSSTflag to thereby determine whether to apply 4×4 RST. Then, if the NSSTflag is 1, residual coding (decoding) on the positions where no validtransform coefficient may exist may be omitted as described above.

In the case of HEVC, upon residual coding, coding is first performed inthe last non-zero coefficient position in the TU. If coding on the NSSTindex is performed after coding on the last non-zero coefficientposition, and the last non-zero coefficient position is a position wherea non-zero coefficient cannot exist under the assumption that 4×4 RST isapplied, the decoding device 200 may be configured not to apply 4×4 RSTwithout decoding the NSST index. For example, since in the positionsmarked with Xs in FIG. 17, no valid transform coefficients arepositioned when 4×4 RST applies (which may be filled with 0's), if thelast non-zero coefficient is positioned in the X-marked area, thedecoding device 200 may skip coding on the NSST index. If the lastnon-zero coefficient is not positioned in the X-marked area, thedecoding device 200 may perform coding on the NSST index.

If it is known whether to apply 4×4 RST by conditionally coding the NSSTindex after coding on the non-zero coefficient position, the restresidual coding may be processed in the following two schemes:

1) Where 4×4 RST is not applied, regular residual coding is performed.That is, coding is performed under the assumption that a non-zerotransform coefficient may exist in any position from the last non-zerocoefficient position to the DC.

2) Where 4×4 RST is applied, no transform coefficient exists on aspecific position or specific 4×4 block (e.g., the X position in FIG.17) (which is filled with 0 as default). Thus, residual coding on theposition or block may be omitted. For example, upon arriving at theX-marked position while scanning according to the scan order of FIG. 17,coding on the flag (sig_coeff_flag) as to whether there is a non-zerocoefficient in the position in the HEVC standard may be omitted. Wherethe transform coefficients of two blocks are merged into one block asshown in FIG. 18, coding on the flag (e.g., coded_sub_block_flag in theHEVC standard) indicating whether to apply residual coding on the 4×4block filled with 0's may be omitted, and the value may be led to 0, andthe 4×4 block may be filled with 0's without separate coding.

Where the NSST index is coded after coding on the last non-zerocoefficient position, if the x position (Px) and y position (Py) of thelast non-zero coefficient are smaller than Tx and Ty, respectively,coding on the NSST index is omitted, and no 4×4 RST may be applied. Forexample, if Tx=1, Ty=1, and the last non-zero coefficient is present inthe DC position, NSST index coding is omitted. Such a scheme ofdetermining whether to perform NSST index coding via comparison with athreshold may be differently applied to the luma component and chromacomponent. For example, different Tx and Ty may be applied to respectiveof the luma component and the chroma component, and a threshold may beapplied to the luma component, but not to the chroma component. Incontrast, a threshold may be applied to the chroma component but not tothe luma component.

The above-described two methods may be applied simultaneously (if thelast non-zero coefficient is positioned in the area where no validtransform coefficient exists, NSST index coding is omitted and, when theX and Y coordinates for the last non-zero coefficient each are smallerthan the threshold, NSST index coding is omitted). For example, thethreshold comparison for the position coordinates for the last non-zerocoefficient is first identified and it may then be checked whether thelast non-zero coefficient is positioned in the area where a validtransform coefficient does not exist, and the two methods may beinterchanged in order.

The methods proposed in embodiment 4) may also apply to 8×8 RST. Thatis, if the last non-zero coefficient is positioned in the area which isnot the top-left 4×4 in the top-left 8×8 area, NSST index coding may beomitted and, otherwise, NSST index coding may be performed. Further, ifthe X and Y coordinates for the position of the last non-zerocoefficient both are less than a certain threshold, NSST index codingmay be omitted. The two methods may be performed simultaneously.

Embodiment 5: Application of Different NSST Index Coding and ResidualCoding to Each of Luma Component and Chroma Component Upon RSTApplication

The schemes described above in connection with embodiments 3 and 4 maybe differently applied to the luma component and chroma component. Thatis, different NSST index coding and residual coding schemes may beapplied to the luma component and chroma component. For example, thescheme described above in connection with embodiment 4 may be applied tothe luma component, and the scheme described above in connection withembodiment 3 may be applied to the chroma component. Further, theconditional NSST index coding proposed in embodiment 3 or 4 may beapplied to the luma component, and the conditional NSST index coding maynot be applied to the luma component, and vice versa (the conditionalNSST index coding applied to the chroma component but not to the lumacomponent).

Embodiment 6

According to an embodiment of the disclosure, there are provided a mixedNSST transform set (MNTS) for applying various NSST conditions duringthe course of applying the NSST and a method of configuring the MNTS.

As per the JEM, the 4×4 NSST set includes only 4×4 kernel, and 8×8 NSSTset includes only 8×8 kernel depending on the size of a preselected lowblock. According to an embodiment of the disclosure, there is alsoproposed a method of configuring a mixed NSST set as follows.

-   -   The NSST set may include NSST kernels which are available in the        NSST set and have one or more variable sizes, but not fixed size        (e.g., 4×4 NSST kernel and 8×8 NSS kernel both are included in        one NSST set).    -   The number of NSST kernels available in the NSST set may be not        fixed but varied (e.g., a first set includes three kernels, and        a second set includes four kernels).    -   The order of NSST kernels may be variable, rather than fixed,        depending on the NSST set (e.g., in the first set, NSST kernels        1, 2, and 3 are mapped to NSST indexes 1, 2, and 3,        respectively, but, in the second set, NSST kernels 3, 2, and 1        are mapped to NSST indexes 1, 2, and 3, respectively).

More specifically, the following is an example method of configuring amixed NSST transform set.

-   -   The priority of NSST kernels available in the NSST transform set        may be determined depending on the NSST kernel size (e.g., 4×4        NSST and 8×8 NSST).

For example, if the block is large, the 8×8 NSST kernel may be moreimportant than the 4×4 NSST kernel. Thus, an NSST index which is a smallvalue is assigned to the 8×8 NSST kernel.

-   -   The priority of NSST kernels available in the NSST transform set        may be determined depending on the order of NSST kernels.

For example, a given 4×4 NSST first kernel may be prioritized over a 4×4NSST second kernel.

Since the NSST index is encoded and transmitted, a higher priority(smaller index) may be allocated to the NSST kernel which is morefrequent, so that the NSST index may be signaled with fewer bits.

Tables 1 and 2 below represent an example mixed NSST set proposedaccording to the instant embodiment.

TABLE 1 NSST 4 × 4 NSST Set 8 × 8 NSST Set Mixed NSST Set index (JEM)(JEM) (proposed) 1 4 × 4 1^(st) Kernel 8 × 8 1^(st) Kernel 8 × 8 1^(st)Kernel 2 4 × 4 2^(nd) Kernel 8 × 8 2^(nd) Kernel 8 × 8 2^(nd) Kernel 3 4× 4 3^(rd) Kernel 8 × 8 3^(rd) Kernel 4 × 4 1^(st) Kernel . . . . . . .. . . . .

TABLE 2 NSST Mixed NSST Set Mixed NSST Set Mixed NSST Set index Type1Type2 Type3 1 8 × 8 3^(rd) Kernel 8 × 8 1^(st) Kernel 4 × 4 1^(st)Kernel 2 8 × 8 2^(nd) Kernel 8 × 8 2^(nd) Kernel 8 × 8 1^(st) Kernel 3 8× 8 1^(st) Kernel 4 × 4 1^(st) Kernel 4 × 4 2^(nd) Kernel 4 N.A. 4 × 42^(st) Kernel 8 × 8 2^(nd) Kernel 5 N.A. 4 × 4 3^(rd) Kernel . . . . . .

Embodiment 7

According to an embodiment of the disclosure, there is proposed a methodof determining an NSST set considering block size and intra predictionmode during the course of determining a secondary transform set.

The method proposed in the instant embodiment configures a transform setsuited for the intra prediction mode in association with embodiment 6,allowing various sizes of kernels to be configured and applied toblocks.

FIG. 19 illustrates an example method of configuring a mixed NSST setper intra prediction mode according to an embodiment of the disclosure.

FIG. 19 illustrates an example table according to applying the methodproposed in embodiment 2 in association with embodiment 6. In otherwords, as shown in FIG. 19, there may be defined an index (‘Mixed Type’)indicating whether each intra prediction mode follows the legacy NSSTset configuration method or other NSST set configuration method.

More specifically, in the case of the intra prediction mode where theindex (‘Mixed Type’) of FIG. 19 is defined as ‘1,’ the NSST setconfiguration method of the JEM is not followed but the NSST setconfiguration method defined in the system is used to configure the NSSTset. Here, the NSST set configuration method defined in the system maymean the mixed NSST set proposed in embodiment 6.

As another embodiment, although two kinds of transform set configurationmethods (JEM-based NSST set configuration and the mixed type NSST setconfiguration method proposed according to an embodiment of thedisclosure) based on mixed type information (flag) related to intraprediction mode are described in connection with the table of FIG. 19,there may be one or more mixed type NSST configuration methods, and themixed type information may be represented as N (N>2) various values.

In another embodiment, it may be determined whether to configure thetransform set appropriate for the current block in a mixed type,considering the intra prediction mode and the transform block size both.For example, if the mode type corresponding to the intra prediction modeis 0, the NSST set configuration of the JEM is followed, otherwise (ModeType==1), various mixed types of NSST sets may be determined dependingon the transform block size.

FIG. 20 illustrates an example method of selecting an NSST set (orkernel) considering the size of transform block and an intra predictionmode according to an embodiment of the disclosure.

When the transform set is determined, the decoding device 200 maydetermine the used NSST kernel using the NSST index information.

Embodiment 8

According to an embodiment of the disclosure, there is provided a methodfor efficiently encoding the NSST index considering a variation instatistical distribution of the NSST index transmitted after encoding,when the transform set is configured considering both the intraprediction mode and the block size during the course of applying thesecondary transform. According to an embodiment of the disclosure, thereis provided a method of selecting a kernel to be applied using thesyntax indicating the kernel size.

According to an embodiment of the disclosure, there is also provided atruncated unary binarization method as shown in Table 3 as follows,depending on the maximum NSST index value available per set forefficient binarization since the number of available NSST kernelsdiffers per transform set.

TABLE 3 Binarization1 Binarization2 Binarization3 Binarization4 NSST(Maximum (Maximum (Maximum (Maximum Index index: 2) index: 3) index: 4)index: 5) . . . 0 0 0 0 0 . . . 1 10 10 10 10 . . . 2 11 110 110 110 . .. 3 N.A 111 1110 1110 . . . 4 N.A 1111 11110 . . . 5 N.A 11111 . . . . .. N.A . . .

Table 3 represents binarization of the NSST index. Since the number ofNSST kernels available differs per transform set, the NSST index may bebinarized according to the maximum NSST index value.

Embodiment 9: Reduced Transform

There is provided a reduced transform applicable to core transforms(e.g., DCT or DST) and secondary transforms (e.g., NSST) due tocomplexity issues (e.g., large block transforms or non-separabletransforms).

A main idea for the reduced transform is to map an N-dimensional vectorto an R-dimensional vector in another space, where R/N (R<N> is areduction factor. The reduced transform is an R×M matrix as expressed inEquation 3 below.

$\begin{matrix}{T_{RXN} = \begin{bmatrix}t_{11} & \cdots & t_{1N} \\\vdots & \ddots & \vdots \\t_{R\; 1} & \cdots & t_{RN}\end{bmatrix}} & \left\lbrack {{Equation}\mspace{14mu} 3} \right\rbrack\end{matrix}$

In Equation 1, the R rows of the transform are R bases in a newN-dimensional space. Hence, the reason why the reduced transform is sonamed is that the number of elements of the vector output by thetransform is smaller than the number of elements of the vector input(R<N). The inverse transform matrix for the reduced transform is thetransposition of a forward transform. The forward and inverse reducedtransforms are described below with reference to FIGS. 21A and 21B.

FIGS. 21A and 21B illustrate forward and inverse reduced transformaccording to an embodiment of the disclosure.

The number of elements in the reduced transform is R×N which is R/Nsmaller than the size of the complete matrix (N×N), meaning that therequired memory is R/N of the complete matrix.

Further, the number of products required is R×N which is R/N smallerthan the original N×N.

If X is an N-dimensional vector, R coefficients are obtained after thereduced transform is applied, meaning that it is sufficient to transferonly R values instead of N coefficients as originally intended.

FIG. 22 is a flowchart illustrating an example of decoding using areduced transform according to an embodiment of the disclosure.

The proposed reduced transform (inverse transform in the decoder) may beapplied to coefficients (inversely quantized coefficients) as shown inFIG. 21. A predetermined reduction factor (R or R/N) and a transformkernel for performing the transform may be required. Here, the transformkernel may be determined based on available information, such as blocksize (width or height), intra prediction mode, or Cidx. If a currentcoding block is a luma block, Cldx is 0. Otherwise (Cb or Cr block),Cldx is a non-zero value, e.g., 1.

The operators used below in the disclosure are defined as shown inTables 4 and 5.

TABLE 5 Relational operators The following relational operators aredefined as follows: . Greater than. . . Greater than or equal to. . Lessthan. . . Less than or equal to. . . Equal to. ! . Not equal to. FIG. 23is a flowchart illustrating an example for applying conditional reduced

TABLE 4 Logical operators The following logical operators are defined asfollows: x && y Boolean logical ″and″ of x and y. x || y Boolean logical″or″ of x and y. ! Boolean logical ″not″. x ? y : z If x is TRUE or notequal to 0, evaluates to the value of y; otherwise, evaluates to thevalue of z.

transform according to an embodiment of the disclosure. The operationsof FIG. 23 may be performed by the inverse quantizer 140 and the inversetransformer 150 of the decoding device 200.

According to an embodiment, the reduced transform may be used when aspecific condition is met. For example, the reduced transform may beapplied to blocks larger than a predetermined size as follows.

-   -   Width>TH && Height>HT (where TH is a predefined value (e.g., 4))

Or,

-   -   Width*Height>K && MIN (width, height)>TH (K and TH are        predefined values)

That is, the reduced transform may be applied when the width of thecurrent block is larger than the predefined value (TH), and the heightof the current block is larger than the predefined value (TH) as in theabove conditions. Or, the reduced transform may be applied when theproduct of the width and height of the current block is larger than thepredetermined value (K), and the smaller of the width and height of thecurrent block is larger than the predefined value (TH).

The reduced transform may be applied to a group of predetermined blocksas follows.

-   -   Width==TH && Height==TH

Or,

-   -   Width==Height

That is, if the width and height, each, of the current block isidentical to the predetermined value (TH) or the width and height of thecurrent block are identical (when the current block is a square block),the reduced transform may be applied.

Unless the conditions for using the reduced transform are met, regulartransform may apply. The regular transform may be a transform predefinedand available in the video coding system. Examples of the regulartransform are as follows.

-   -   DCT-2, DCT-4, DCT-5, DCT-7, DCT-8

Or,

-   -   DST-1, DST-4, DST-7

Or,

-   -   non-separable transform

Or,

-   -   JEM-NSST (HyGT)

As shown in FIG. 23, the reduced transform may rely on the index(Transform_idx) indicating which transform (e.g., DCT-4 or DST-1) is tobe used or which kernel is to be applied (when a plurality of kernelsare available). In particular, Transmission_idx may be transmitted twotimes. One is an index (Transform_idx_h) indicating horizontaltransform, and the other is an index (Transform_idx_v) indicatingvertical transform.

More specifically, referring to FIG. 23, the decoding device 200performs inverse quantization on an input bitstream (S2305). Thereafter,the decoding device 200 determines whether to apply transform (S2310).The decoding device 200 may determine whether to apply the transform viaa flag indicating whether to skip the transform.

Where the transform applies, the decoding device 200 parses thetransform index (Transform_idx) indicating the transform to be applied(S2315). Or, the decoding device 200 may select a transform kernel(S2330). For example, the decoding device 200 may select the transformkernel corresponding to the transform index (Transform_idx). Further,the decoding device 200 may select the transform kernel consideringblock size (width, height), intra prediction mode, or Cldx (luma,chroma).

The decoding device 200 determines whether the conditions for applyingthe reduced transform is met (S2320). The conditions for applying thereduced transform may include the above-described conditions. When thereduced transform is not applied, the decoding device 200 may applyregular inverse transform (S2325). For example, in step S2330, thedecoding device 200 may determine the inverse transform matrix from theselected transform kernel and may apply the determined inverse transformmatrix to the current block including transform coefficients.

When the reduced transform is applied, the decoding device 200 may applyreduced inverse transform (S2335). For example, in step S2330, thedecoding device 200 may determine the reduced inverse transform matrixfrom the selected transform kernel considering the reduction factor andmay apply the reduced inverse transform matrix to the current blockincluding transform coefficients.

FIG. 24 is a flowchart illustrating an example of decoding for secondaryinverse-transform to which conditional reduced transform applies,according to an embodiment of the disclosure. The operations of FIG. 24may be performed by the inverse transformer 230 of the decoding device200.

According to an embodiment, the reduced transform may be applied to thesecondary transform as shown in FIG. 24. If the NSST index is parsed,the reduced transform may be applied.

Referring to FIG. 24, the decoding device 200 performs inversequantization (S2405). The decoding device 200 determines whether toapply the NSST to the transform coefficients generated via the inversequantization (S2410). That is, the decoding device 200 determineswhether it is needed to parse the NSST index (NSST_indx) depending onwhether to apply the NSST.

When the NSST is applied, the decoding device 200 parses the NSST index(S2415) and determines whether the NSST index is larger than 0 (S2420).The NSST index may be reconstructed via such a scheme as CABAC, by theentropy decoder 210. When the NSST index is 0, the decoding device 200may omit secondary inverse transform and apply core inverse transform orprimary inverse transform (S2445).

Further, when the NSST is applied, the decoding device 200 selects atransform kernel for the secondary inverse transform (S2435). Forexample, the decoding device 200 may select the transform kernelcorresponding to the NSST index (NSST_idx). Further, the decoding device200 may select the transform kernel considering block size (width,height), intra prediction mode, or Cldx (luma, chroma).

When the NSST index is larger than 0, the decoding device 200 determineswhether the condition for applying the reduced transform is met (S2425).The condition for applying the reduced transform may include theabove-described conditions. When the reduced transform is not applied,the decoding device 200 may apply regular secondary inverse transform(S2430). For example, in step S2435, the decoding device 200 maydetermine the secondary inverse transform matrix from the selectedtransform kernel and may apply the determined secondary inversetransform matrix to the current block including transform coefficients.

When the reduced transform is applied, the decoding device 200 may applyreduced secondary inverse transform (S2440). For example, in step S2335,the decoding device 200 may determine the reduced inverse transformmatrix from the selected transform kernel considering the reductionfactor and may apply the reduced inverse transform matrix to the currentblock including transform coefficients. Thereafter, the decoding device200 applies core inverse transform or primary inverse transform (S2445).

Embodiment 10: Reduced Transform as a Secondary Transform with DifferentBlock Size

FIGS. 25A, 25B, 26A, and 26B illustrate examples of reduced transformand reduced inverse-transform according to an embodiment of thedisclosure.

According to an embodiment of the disclosure, the reduced transform maybe used as the secondary transform and secondary inverse transform inthe video codec for different block sizes, such as 4×4, 8×8, or 16×16.As an example for the 8×8 block size and reduction factor R=16, thesecondary transform and secondary inverse transform may be set as shownin FIGS. 25A and 25B.

The pseudocode of the reduced transform and reduced inverse transformmay be set as shown in FIG. 26.

TABLE 6 for i from 1 to R:  c_(i) = 0  for j from 1 to N:   c_(i) + =t_(i,j) * r_(j)

TABLE 7 for i from 1 to N:  r_(j) = 0  for j from 1 to R:   r_(j) + =t_(j,i) * c_(j)

Embodiment 11: Reduced Transform as a Secondary Transform withNon-Rectangular Shape

FIG. 27 illustrates an example area to which reduced secondary transformapplies according to an embodiment of the disclosure.

As described above, the secondary transform may be applied to the 4×4and 8×8 corners due to complexity issues. The reduced transform may beapplied to non-square shapes.

As shown in FIG. 27, the RST may be applied only to some area (hatchedarea) of the block. In FIG. 27, each square represents a 4×4 area, andthe RST may be applied to 10 4×4 pixels (i.e., 160 pixels). Wherereduction factor R=16, the whole RST matrix is a 16×16 matrix, and thismay be the amount of computation that is acceptable.

Embodiment 12: Reduction Factor

FIG. 28 illustrates reduced transform according to a reduced factoraccording to an embodiment of the disclosure.

A change in the reduction factor may lead to a variation in memory andmultiplication complexity. As described above, the memory andmultiplication complexity may be reduced by the factor R/N owing to thechange to the reduction factor. For example, where R=16 for the 8×8NSST, the memory and multiplication complexity may be reduced by ¼.

Embodiment 13: High Level Syntax

The following syntax elements may be used to process the RST in videocoding. The semantics related to the reduced transform may be present inthe sequence parameter set (SPS) or slice header.

Reduced_transform_enabled_flag being 1 represents that the reducedtransform is possible and applied. Reduced_transform_enabled_flag being0 represents that the reduced transform is not possible. WhenReduced_transform_enabled_flag does not exist, it is inferred to be 0.(Reduced_transform_enabled_flag equals to 1 specifies that reducedtransform is enabled and applied. Reduced_transform_enabled_flag equalto 0 specifies that reduced transform is not enabled. WhenReduced_transform_enabled_flag is not present, it is inferred to beequal to 0).

Reduced_transform_factor indicates the number of reduced dimensions tobe maintained for the reduced transform. Reduced_transform_factor beingabsent, it is inferred to be identical to R. (Reduced_transform_factorspecifies that the number of reduced dimensions to keep for reducedtransform. When Reduced_transform_factor is not present, it is inferredto be equal to R).

min_reduced_transform_size indicates the minimum transform size to applythe reduced transform. min_reduced_transform_size being absent, it isinferred to be 0. (min_reduced_transform_size specifies that the minimumtransform size to apply reduced transform. Whenmin_reduced_transform_size is not present, it is inferred to be equal to0).

max_reduced_transform_size indicates the maximum transform size to applythe reduced transform. max_reduced_transform_size being absent, it isinferred to be 0.

reduced_transform_factor indicates the number of reduced dimensions tobe maintained for the reduced transform. reduced_transform_size beingabsent, it is inferred to be 0. (reduced_transform_size specifies thatthe number of reduced dimensions to keep for reduced transform. WhenReduced_transform_factor is not present, it is inferred to be equal to0.)

TABLE 8 Descriptor seq_parameter_set_rbsp( ) {sps_video_parameter_set_id u(4) sps_max_sub_layers_minus1 u(3)sps_temporal_id_nesting_flag u(1) profile_tier_level(sps_max_sub_layers_minus1 ) sps_seq_parameter_set_id ue(v)chroma_format_idc ue(v) if( chroma_format_idc == 3 )separate_colour_plane_flag u(1) pic_width_in_luma_samples ue(v)pic_height_in_luma_samples ue(v) conformance_window_flag u(1) if(conformance_window_flag ) { conf_win_left_offset ue(v)conf_win_right_offset ue(v) conf_win_top_offset ue(v)conf_win_bottom_offset ue(v) } ... Reduced_transform_enabled_flag u(1)If(reduced_transform_enabled_flag) { reduced_transform_factor ue(v)min_reduced_transform_size ue(v) max_reduced_transform_size ue(v)reduced_transform_size ue(v) } sps_extension_flag u(1) if(sps_extension_flag ) while( more_rbsp_data( ) ) sps_extension_data_flagu(1) rbsp_trailing_bits( ) }

Embodiment 14: Conditional Application of 4×4 RST for Worst CaseHandling

The non-separable secondary transform (4×4 NSST) applicable to a 4×4block is 16×16 transform. The 4×4 NSST is secondarily applied to theblock that has undergone the primary transform, such as DCT-2, DST-7, orDCT-8. When the size of the primary transform-applied block is N×M, thefollowing method may be considered upon applying the 4×4 NSST to the N×Mblock.

1) The following are conditions a) and b) to apply the 4×4 NSST to theN×M area.

a) N>=4

b) M>=4

2) 4×4 NSST may be applied to some, rather than all, N×M areas. Forexample, the 4×4 NSST may be applied only to the top-left K×J area. a)and b) below are conditions for this case.

a) K>=4

b) J>=4

3) The area to which the secondary transform is to be applied may besplit into 4×4 blocks, and 4×4 NSST may be applied to each block.

The computation complexity of the 4×4 NSST is a very criticalconsideration for the encoder and decoder, and this is thus analyzed indetail. In particular, the computational complexity of the 4×4 NSST isanalyzed based on the multiplication count. In the case of forward NSST,the 16×16 secondary transform consists of 16 row directional transformbasis vectors, and the inner product of the 16×1 vector and eachtransform basis vector leads to a transform coefficient for thetransform basis vector. The process of obtaining all the transformcoefficients for the 16 transform basis vectors is to multiply the 16×16non-separable transform matrix by the input 16×1 vector. Thus, the totalmultiplication count required for the 4×4 forward NSST is 256.

When inverse 16×16 non-separable transform is applied to the 16×1transform coefficient in the decoder (when such effects as those ofquantization and integerization are disregarded), the coefficients oforiginal 4×4 primary transform block may be reconstructed. In otherwords, data in the form of a 16×1 vector may be obtained by multiplyingthe inverse 16×16 non-separable transform matrix by the 16×1 transformcoefficient vector and, if data is sorted in the row-first orcolumn-first order as first applied, the 4×4 block signal (primarytransform coefficient) may be reconstructed. Thus, the totalmultiplication count required for the 4×4 inverse NSST is 256.

As described above, when the 4×4 NSST is applied, the multiplicationcount required per sample unit is 16. This is the number obtained whendividing the total multiplication count, 256, which is obtained duringthe course of the inner product of each transform basis vector and the16×1 vector by the total number, 16, of samples, which is the process ofperforming the 4×4 NSST. The multiplication count required for both theforward 4×4 NSST and the inverse 4×4 NSST is 16.

In the case of an 8×8 block, the multiplication count per samplerequired upon applying the 4×4 NSST is determined depending on the areawhere the 4×4 NSST has been applied.

1. Where 4×4 NSST is applied only to a top-left 4×4 area: 256(multiplication count necessary for 4×4 NSST process)/64 (total samplecount in 8×8 block)=4 multiplication count/samples

2. Where 4×4 NSST is applied to top-left 4×4 area and top-right 4×4area: 512 (multiplication count necessary for two 4×4 NSSTs)/64 (totalsample count in 8×8 block)=8 multiplication count/samples

3. Where 4×4 NSST is applied to all 4×4 areas in 8×8 block: 1024(multiplication count necessary for four 4×4 NSSTs)/64 (total samplecount in 8×8 block)=16 multiplication count/samples

As described above, if the block size is large, the range of applyingthe 4×4 NSST may be reduced in order to reduce the multiplication countin the worst scenario case required at each sample end.

Thus, if the 4×4 NSST is used, the worst scenario case arises when theTU size is 4×4. In this case, the following methods may reduce the worstcase complexity.

Method 1. Do not apply 4×4 NSST to smaller TUs (i.e., 4×4 TUs).

Method 2. Apply 4×4 RST, rather than 4×4 NSST, to 4×4 blocks (4×4 TUs).

It was experimentally observed that method 1 caused significantdeterioration of encoding performance as it does not apply 4×4 NSST. Itwas revealed that method 2 was able to reconstruct a signal very closeto the original signal by applying inverse transform to some transformcoefficients positioned ahead even without using all the transformcoefficients in light of the statistical characteristics of the elementsof the 16×1 transform coefficient vector and was thus able to maintainmost of the encoding performance.

Specifically, in the case of 4×4 RST, when inverse (or forward) 16×16non-separable transform consists of 16 column basis vectors, only Lcolumn basis vectors are left, and a 16×L matrix is configured. As Lmore critical transform coefficients alone are left among the transformcoefficients, the product of the 16×L matrix and the L×1 vector may leadto reconstruction of the 16×1 vector which makes little difference fromthe original 16×1 vector data.

Resultantly, only L coefficients involve the data reconstruction. Thus,to obtain the transform coefficient, it is enough to obtain the Latransform coefficient vector, not the 16×1 transform coefficient vector.That is, the L×16 transform matrix is configured by selecting L rowdirection transform vectors from the forward 16×16 non-separabletransform matrix, and L transform coefficients are obtained bymultiplying the L×16 transform matrix by a 16×1 input vector.

L is subject to the range 1<=L<16. Generally, L transform basis vectorsmay be selected from 16 transform basis vectors by any method. However,it may be advantageous in view of encoding efficiency to selecttransform basis vectors with higher importance in signal energy aspectin light of encoding and decoding as described above. The per-sampleworst case multiplication count in the 4×4 block according to atransform on the L value is as shown in Table 9 below.

TABLE 9 total per-pixel L multiplication multiplication 16 256 16 8 1288 4 64 4 2 32 2

As described above, the 4×4 NSST and the 4×4 RST may be comprehensivelyused as shown in Table 10 below so as to reduce the worst casemultiplication complexity. (however, the following example describes theconditions for applying the 4×4 NSST and the 4×4 RST under theconditions for applying the 4×4 NSST (that is, when the width andheight, both, of the current block are equal to or larger than 4)).

As described above, the 4×4 NSST for the 4×4 block is a square (16×16)transform matrix that receives 16 pieces of data and outputs 16 piecesof data, and the 4×4 RST means a non-square (8×16) transform matrix thatreceives 16 pieces of data and outputs R (e.g., eight) pieces of data,which are fewer than 16, with respect to the encoder side. The 4×4 RSTmeans a non-square (16×8) transform matrix that receives R (e.g., eight)pieces of data, which are fewer than 16, and outputs 16 pieces of datawith respect to the decoder side.

TABLE 10 If (block width == 4 and block height ==4) Apply 4×4 RST basedon 8×16 matrix Else Apply 4×4 NSST for Top-left 4×4 region

Referring to Table 10, when the width and height of the current blockare 4, the 8×16 matrix-based 4×4 RST is applied to the current block,otherwise (if either the width or height of the current block is not 4),the 4×4 NSST may be applied to the top-left 4×4 area of the currentblock. More specifically, if the size of the current block is 4×4,non-separable transform with an input length of 16 and an output lengthof 8 may be applied. In the case of inverse non-separable transform,non-separable transform with an input length of 8 and an output lengthof 16 may be applied.

As described above, the 4×4 NSST and the 4×4 RST may be used incombination as shown in Table 11 below so as to reduce the worst casemultiplication complexity. (however, the following example describes theconditions for applying the 4×4 NSST and the 4×4 RST under theconditions for applying the 4×4 NSST (that is, when the width andheight, both, of the current block are equal to or larger than 4)).

TABLE 11 If (block width == 4 and block height ==4)  Apply 4×4 RST basedon 8×16 matrix Else if (block width X block height < TH) (TH ispredefined value such as 64)  Apply 4×4 NSST for Top-left 4×4 regionElse if (block width >= block height)  Apply 4×4 NSST for Top-left 4×4region  and the very right 4×4 region of Top-left 4×4 region Else  Apply4×4 NSST for Top-left 4×4 region and and  the very below 4×4 region ofTop-left 4×4 region

Referring to Table 11, when the width and height of the current blockeach are 4, the 8×16 matrix-based 4×4 RST is applied and, if the productof the width and height of the current block is smaller than thethreshold (TH), the 4×4 NSST is applied to the top-left 4×4 area of thecurrent block and, if the width of the current block is equal to orlarger than the height, the 4×4 NSST is applied to the top-left 4×4 areaof the current block and the 4×4 area positioned to the right of thetop-left 4×4 area, and for the rest (when the product of the width andheight of the current block is equal to or larger than the threshold andthe width of the current block is smaller than the height), the 4×4 NSSTis applied to the top-left 4×4 area of the current block and the 4×4area positioned under the top-left 4×4 area.

Resultantly, the 4×4 RST (e.g., 8×16 matrix), instead of the 4×4 NSST,may be applied to the 4×4 block to reduce the computational complexityof the worst case multiplication.

Embodiment 15: Conditional Application of 8×8 RST for Worst CaseHandling

The non-separable secondary transform (8×8 NSST) applicable to one 8×8block is a 64×64 transform. The 8×8 NSST is secondarily applied to theblock that has undergone the primary transform, such as DCT-2, DST-7, orDCT-8. When the size of the primary transform-applied block is N×M, thefollowing method may be considered upon applying the 8×8 NSST to the N×Mblock.

1) The following are conditions c) and d) to apply the 8×8 NSST to theN×M area.

c) N>=8

d) M>=8

2) 8×8 NSST may be applied to some, rather than all, N×M areas. Forexample, the 8×8 NSST may be applied only to the top-left K×J area. c)and d) below are conditions for this case.

c) K>=8

d) J>=8

3) The area to which the secondary transform is to be applied may besplit into 8×8 blocks, and 8×8 NSST may be applied to each block.

The computation complexity of the 8×8 NSST is a very criticalconsideration for the encoder and decoder, and this is thus analyzed indetail. In particular, the computational complexity of the 8×8 NSST isanalyzed based on the multiplication count. In the case of forward NSST,the 64×64 secondary transform consists of 64 row direction transformbasis vectors, and the inner product of the 64×1 vector and eachtransform basis vector leads to a transform coefficient for thetransform basis vector. The process of obtaining all the transformcoefficients for the 64 transform basis vectors is to multiply the 64×64non-separable transform matrix by the input 64×1 vector. Thus, the totalmultiplication count required for the 8×8 forward NSST is 4,096.

When the inverse 64×64 non-separable transform is applied to the 64×1transform coefficient in the decoder (when such effects as those ofquantization and integerization are disregarded), the coefficient oforiginal 8×8 primary transform block may be reconstructed. In otherwords, data in the form of a 64×1 vector may be obtained by multiplyingthe inverse 64×64 non-separable transform matrix by the 64×1 transformcoefficient vector and, if data is sorted in the row-first orcolumn-first order as first applied, the 8×8 block signal (primarytransform coefficient) may be reconstructed. Thus, the totalmultiplication count required for the 8×8 inverse NSST is 4,096.

As described above, when the 8×8 NSST is applied, the multiplicationcount required per sample unit is 64. This is the number obtained whendividing the total multiplication count, 4,096, which is obtained duringthe course of the inner product of each transform basis vector and the64×1 vector by the total number, 64, of samples, which is the process ofperforming the 8×8 NSST. The multiplication count required for both theforward 8×8 NSST and the inverse 8×8 NSST is 64.

In the case of a 16×16 block, the multiplication count per samplerequired upon applying the 8×8 NSST is determined depending on the areawhere the 8×8 NSST has been applied.

1. Where 8×8 NSST is applied only to top-left 8×8 area: 4096(multiplication count necessary for 8×8 NSST process)/256 (total samplecount in 16×16 block)=16 multiplication count/samples

2. Where 8×8 NSST is applied to top-left 8×8 area and top-right 8×8area: 8192 (multiplication count necessary for two 8×8 NSSTs)/256 (totalsample count in 16×16 block)=32 multiplication count/samples

3. Where 8×8 NSST is applied to all 8×8 areas in 16×16 block: 16384(multiplication count necessary for four 8×8 NSSTs)/256 (total samplecount in 16×16 block)=64 multiplication count/samples

As described above, if the block size is large, the range of applyingthe 8×8 NSST to reduce the multiplication count in the worst scenariocase required per sample end may be reduced.

Where the 8×8 NSST applies, since the 8×8 block is the smallest TU towhich the 8×8 NSST is applicable, the case where the TU size is 8×8 isthe worst case in light of the multiplication count required per sample.In this case, the following methods may reduce the worst casecomplexity.

Method 1. Do not apply 8×8 NSST to smaller TUs (i.e., 8×8 TUs).

Method 2. Apply 8×8 RST, rather than 8×8 NSST, to 8×8 blocks (8×8 TUs).

It was experimentally observed that method 1 caused significantdeterioration of encoding performance as it does not apply 8×8 NSST. Itwas revealed that method 2 was able to reconstruct a signal very closeto the original signal by applying an inverse transform to sometransform coefficients positioned ahead even without using all thetransform coefficients in light of the statistical characteristics ofthe elements of the 64×1 transform coefficient vector and was thus ableto maintain most of the encoding performance.

Specifically, in the case of 8×8 RST, when the inverse (or forward)64×64 non-separable transform consists of 16 column basis vectors, onlyL column basis vectors are left, and the 64×L matrix is configured. As Lmore critical transform coefficients alone are left among the transformcoefficients, the product of the 64×L matrix and the L×1 vector may leadto reconstruction of the 64×1 vector which makes little difference fromthe original 64×1 vector data.

Resultantly, only L coefficients involve the data reconstruction. Thus,to obtain the transform coefficient, it is enough to obtain the Latransform coefficient vector, not the 64×1 transform coefficient vector.That is, the L×64 transform matrix is configured by selecting L rowdirection transform vectors from the forward 64×64 non-separabletransform matrix, and L transform coefficients are obtained bymultiplying the L×64 transform matrix by the 64×1 input vector.

L is subject to the range 1<=L<64. Generally, L transform basis vectorsmay be selected from 64 transform basis vectors by any method. However,it may be advantageous in view of encoding efficiency to selecttransform basis vectors with higher importance in signal energy aspectin light of encoding and decoding as described above. The per-sampleworst case multiplication count in the 8×8 block according to atransform on the L value is as shown in Table 12 below.

TABLE 12 total per-pixel L multiplication multiplication 64 4096 64 322048 32 16 1024 16 8 512 8 4 256 4

As described above, the 8×8 RSTs with different L values may becomprehensively used as shown in Table 13 below so as to reduce theworst case multiplication complexity. (however, the following exampledescribes the conditions for applying the 8×8 RST under the conditionsfor applying the 8×8 NSST (that is, when the width and height, both, ofthe current block are equal to or larger than 8)).

TABLE 13 If (block width == 8 and block height ==8)  Apply 8×8 RST basedon 8×64 matrix (where L is 8) Else  Apply 8×8 RST based on 16×64 matrix(where L is 16)

Referring to Table 13, when the width and height, each, of the currentblock are 8, the 8×64 matrix-based 8×8 RST is applied to the currentblock, otherwise (if either the width or height of the current block isnot 8), the 16×64 matrix-based 8×8 RST may be applied to the currentblock. More specifically, when the size of the current block is 8×8, thenon-separable transform with an input length of 64 and an output lengthof 8 may be applied, otherwise a non-separable transform with an inputlength of 64 and an output length of 16 may be applied. In the case ofthe inverse non-separable transform, when the current block is 8×8, thenon-separable transform with an input length of 8 and an output lengthof 64 may be applied, otherwise a non-separable transform with an inputlength of 16 and an output length of 64 may be applied.

Table 14 shows an example of applying various 8×8 RSTs under thecondition for applying the 8×8 NSST (i.e., when the width and height,both, of the current block are equal to or larger than 8).

TABLE 14 If (block width == 8 and block height ==8)  Apply 8×8 RST basedon 8×64 matrix Else if (block width X block height < TH) (TH ispredefined value such as 256)  Apply 8×8 RST based on 16×64 matrix  forTop-left 8×8 region Else  Apply 8×8 RST based on 32×64 matrix  forTop-left 8×8 region

Referring to Table 14, when the width and height of the current blockeach are 8, the 8×64 matrix-based 8×8 RST is applied and, if the productof the width and height of the current block is smaller than thethreshold (TH), the 16×64 matrix-based 8×8 RST is applied to thetop-left 8×8 area of the current block and, if the width of the currentblock is equal to or larger than the height, the 32×64 matrix-based 8×8RST is applied to the 4×4 area positioned in the top-left 8×8 area ofthe current block, and for the rest (when the product of the width andheight of the current block is equal to or larger than the threshold andthe width of the current block is smaller than the height), the 32×64matrix-based 8×8 RST is applied to the top-left 8×8 area of the currentblock.

FIG. 29 is a flowchart illustrating an example of decoding to which atransform applies according to an embodiment of the disclosure. Theoperations of FIG. 29 may be performed by the inverse transformer 230 ofthe decoding device 200.

In step S2905, the decoding device 200 determines the input length andoutput length of the non-separable transform based on the height andwidth of the current block. Here, if the height and width, each, of thecurrent block is 4, the input length and output length of thenon-separable transform may be determined to be 8 and 16, respectively.In other words, inverse transform (16×8 matrix-based inverse 4×4 RST) ofthe 8×16 matrix-based 4×4 RST may apply. If each of the height and thewidth of a current block is not equal to 4, the input length and theoutput length of the non-separable transform is determined as 16.

In step S2910, the decoding device 200 determines the non-separabletransform matrix corresponding to the input length and output length ofthe non-separable transform. For example, if the input length and outputlength of the non-separable transform are 8 and 16, respectively (whenthe size of the current block is 4×4), the 16×8 matrix induced from thetransform kernel may be determined as the non-separable transform blockand, if the input length and output length of the non-separabletransform are 16 and 16, respectively (e.g., when the current block issmaller than 8×8 but not 4×4), the 16×16 transform kernel may bedetermined as the non-separable transform.

According to an embodiment of the disclosure, the decoding device 200may determine the non-separable transform set index (e.g., NSST index)based on the intra prediction mode of the current block, determine thenon-separable transform kernel corresponding to the non-separabletransform index in the non-separable transform set included in thenon-separable transform set index, and determine the non-separabletransform matrix from the non-separable transform kernel based on theinput length and output length determined in step S2905.

In step S2915, the decoding device 200 applies the non-separabletransform matrix determined in the current block to the current block.For example, if the input length and output length of the non-separabletransform are 8 and 16, respectively, the 8×16 matrix induced from thetransform kernel may be applied to the current block and, if the inputlength and output length of the non-separable transform are 16 and 16,respectively, the 16×16 matrix induced from the transform kernel may beapplied to the coefficients of the top-left 4×4 area of the currentblock.

For the cases except for where the height and width, each, of thecurrent block are 4, if the product of the width and height of thecurrent block is smaller than the threshold, the decoding device 200 mayapply the non-separable transform matrix to the top-left 4×4 area of thecurrent block, if the width of the current block is equal to or largerthan the height, apply the non-separable transform matrix to thetop-left 4×4 area of the current block and the 4×4 area positioned tothe right of the top-left 4×4 area, and if the product of the width andheight of the current block is equal to or larger than the threshold,and the width of the current block is smaller than the height, apply thenon-separable transform matrix to the top-left 4×4 area of the currentblock and the 4×4 area positioned under the top-left 4×4 area.

FIG. 30 is a block diagram illustrating a device for processing videosignals according to an embodiment of the disclosure. The video signalprocessing device 3000 of FIG. 26 may correspond to the encoding device100 of FIG. 1 or the decoding device 200 of FIG. 2.

The video signal processing device 3000 for processing video signals mayinclude a memory 3020 for storing video signals and a processor 3010coupled with the memory to process video signals.

According to an embodiment of the disclosure, the processor 3010 may beconfigured as at least one processing circuit for processing imagesignals and may execute instructions for encoding or decoding imagesignals to thereby process image signals. In other words, the processor3010 may encode raw image data or decode encoded image signals byexecuting encoding or decoding methods described above.

FIG. 31 illustrates an example video coding system according to anembodiment of the disclosure.

The video coding system may include a source device and a receivingdevice. The source device may transfer encoded video/image informationor data in a file or streaming form to the receiving device via adigital storage medium or network.

The source device may include a video source, an encoding device, and atransmitter. The receiving device may include a receiver, a decodingdevice, and a renderer. The encoding device may be referred to as avideo/image encoding device, and the decoding device may be referred toas a video/image decoding device. The transmitter may be included in theencoding device. The receiver may be included in the decoding device.The renderer may include a display unit, and the display unit may beconfigured as a separate device or external component.

The video source may obtain a video/image by capturing, synthesizing, orgenerating the video/image. The video source may include a video/imagecapturing device and/or a video/image generating device. The video/imagecapturing device may include, e.g., one or more cameras and avideo/image archive including previously captured videos/images. Thevideo/image generating device may include, e.g., a computer, tablet PC,or smartphone, and may (electronically) generate videos/images. Forexample, a virtual video/image may be generated via, e.g., a computer,in which case a process for generating its related data may replace thevideo/image capturing process.

The encoding device may encode the input video/image. The encodingdevice may perform a series of processes, such as prediction, transform,and quantization, for compression and coding efficiency. The encodeddata (encoded video/image information) may be output in the form of abitstream.

The transmitter may transfer the encoded video/image information ordata, which has been output in the bitstream form, in a file orstreaming form to the receiver of the receiving device via a digitalstorage medium or network. The digital storage media may include variouskinds of storage media, such as USB, SD, CD, DVD, Blu-ray, HDD, or SDD.The transmitter may include an element for generating media files in apredetermined file format and an element for transmission over abroadcast/communications network. The receiver may extract the bitstreamand transfer the bitstream to the decoding device.

The decoding device may perform a series of procedures, such as inversequantization, inverse transform, and prediction, corresponding to theoperations of the encoding device, decoding the video/image.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed on the display unit.

FIG. 32 is a view illustrating a structure of a convent streaming systemaccording to an embodiment of the disclosure.

The content streaming system to which the disclosure is applied maylargely include an encoding server, a streaming server, a web server,media storage, a user device, and a multimedia input device.

The encoding server may compress content input from multimedia inputdevices, such as smartphones, cameras, or camcorders, into digital data,generate a bitstream, and transmit the bitstream to the streamingserver. As an example, when the multimedia input devices, such assmartphones, cameras, or camcorders, themselves generate a bitstream,the encoding server may be omitted.

The bitstream may be generated by an encoding or bitstream generationmethod to which the disclosure is applied, and the streaming server maytemporarily store the bitstream while transmitting or receiving thebitstream.

The streaming server may transmit multimedia data to the user devicebased on a user request through the web server, and the web server playsa role as an agent to notify the user what services are provided. If theuser sends a request for a desired service to the web server, the webserver transfers the request to the streaming server, and the streamingserver transmits multimedia data to the user. The content streamingsystem may include a separate control server in which case the controlserver controls commands/responses between the devices in the contentstreaming system.

The streaming server may receive content from the media storage and/orthe encoding server. For example, when content is received from theencoding server, content may be received in real-time. In this case, toseamlessly provide the service, the streaming server may store thebitstream for a predetermined time.

Examples of the user device may include mobile phones, smart phones,laptop computers, digital broadcast terminals, personal digitalassistants (PDAs), portable multimedia players (PMPs), navigationdevices, slate PCs, tablet PCs, ultrabooks, wearable devices, such assmartwatches, smart glasses, or head mounted displays (HMDs), digitalTVs, desktop computers, or digital signage devices.

In the content streaming system, the servers may be distributed serversin which case data received by each server may be distributed andprocessed.

Furthermore, the processing methods to which the present disclosure isapplied may be manufactured in the form of a program executed by acomputer and stored in computer-readable recording media. Multimediadata having the data structure according to the present disclosure mayalso be stored in computer-readable recording media. Thecomputer-readable recording media include all types of storage devicesand distributed storage devices in which data readable by a computer isstored.

The computer-readable recording media may include a Blue ray disk (BD),a universal serial bus (USB), a ROM, a PROM, an EEPROM, a RAM, a CD-ROM,a magnetic tape, a floppy disk, and an optical data storage device, forexample. Furthermore, the computer-readable recording media includesmedia implemented in the form of carrier waves (e.g., transmissionthrough the Internet). Furthermore, a bit stream generated by theencoding method may be stored in a computer-readable recording medium ormay be transmitted over wired/wireless communication networks.

Moreover, embodiments of the present disclosure may be implemented ascomputer program products according to program code and the program codemay be executed in a computer according to embodiment of the presentdisclosure. The program code may be stored on computer-readablecarriers.

As described above, the embodiments of the present disclosure may beimplemented and executed on a processor, a microprocessor, a controlleror a chip. For example, functional units shown in each figure may beimplemented and executed on a computer, a processor, a microprocessor, acontroller or a chip.

Furthermore, the decoder and the encoder to which the present disclosureis applied may be included in multimedia broadcasttransmission/reception apparatuses, mobile communication terminals, homecinema video systems, digital cinema video systems, monitoring cameras,video conversation apparatuses, real-time communication apparatuses suchas video communication, mobile streaming devices, storage media,camcorders, video-on-demand (VoD) service providing apparatuses, overthe top video (OTT) video systems, Internet streaming service providingapparatuses, 3D video systems, video phone video systems, medical videosystems, etc. and may be used to process video signals or data signals.For example, OTT video systems may include game consoles, Blue rayplayers, Internet access TVs, home theater systems, smartphones, tabletPCs, digital video recorders (DVRs), etc.

Furthermore, the processing methods to which the present disclosure isapplied may be manufactured in the form of a program executed by acomputer and stored in computer-readable recording media. Multimediadata having the data structure according to the present disclosure mayalso be stored in computer-readable recording media. Thecomputer-readable recording media include all types of storage devicesand distributed storage devices in which data readable by a computer isstored. The computer-readable recording media may include a Blue raydisk (BD), a universal serial bus (USB), a ROM, a PROM, an EEPROM, aRAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical datastorage device, for example. Furthermore, the computer-readablerecording media includes media implemented in the form of carrier waves(e.g., transmission through the Internet). Furthermore, a bit streamgenerated by the encoding method may be stored in a computer-readablerecording medium or may be transmitted over wired/wireless communicationnetworks.

Moreover, embodiments of the present disclosure may be implemented ascomputer program products according to program code and the program codemay be executed in a computer according to embodiment of the presentdisclosure. The program code may be stored on computer-readablecarriers.

Embodiments described above are combinations of elements and features ofthe present disclosure. The elements or features may be consideredselective unless otherwise mentioned. Each element or feature may bepracticed without being combined with other elements or features.Further, an embodiment of the present disclosure may be constructed bycombining parts of the elements and/or features. Operation ordersdescribed in embodiments of the present disclosure may be rearranged.Some constructions of any one embodiment may be included in anotherembodiment and may be replaced with corresponding constructions ofanother embodiment. It is obvious to those skilled in the art thatclaims that are not explicitly cited in each other in the appendedclaims may be presented in combination as an exemplary embodiment orincluded as a new claim by a subsequent amendment after the applicationis filed.

The implementations of the present disclosure may be achieved by variousmeans, for example, hardware, firmware, software, or a combinationthereof. In a hardware configuration, the methods according to theimplementations of the present disclosure may be achieved by one or moreapplication specific integrated circuits (ASICs), digital signalprocessors (DSPs), digital signal processing devices (DSPDs),programmable logic devices (PLDs), field programmable gate arrays(FPGAs), processors, controllers, microcontrollers, microprocessors,etc.

In a firmware or software configuration, the implementations of thepresent disclosure may be implemented in the form of a module, aprocedure, a function, etc. Software code may be stored in the memoryand executed by the processor. The memory may be located at the interioror exterior of the processor and may transmit data to and receive datafrom the processor via various known means.

Those skilled in the art will appreciate that the present disclosure maybe carried out in other specific ways than those set forth hereinwithout departing from the spirit and essential characteristics of thepresent disclosure. Accordingly, the above embodiments are therefore tobe construed in all aspects as illustrative and not restrictive. Thescope of the present disclosure should be determined by the appendedclaims and their legal equivalents, not by the above description, andall changes coming within the meaning and equivalency range of theappended claims are intended to be embraced therein.

INDUSTRIAL APPLICABILITY

Although exemplary aspects of the present disclosure have been describedfor illustrative purposes, those skilled in the art will appreciate thatvarious modifications, additions and substitutions are possible, withoutdeparting from essential characteristics of the disclosure.

1-12. (canceled)
 13. A method for decoding an image signal, comprising: performing secondary inverse-transform on secondary-transformed coefficients of a current block to generate primary-transformed coefficients for the current block; performing primary inverse-transform on the primary-transformed coefficients of the current block to generate residual samples of the current block; performing intra prediction on the current block to generate prediction samples of the current block; and generate reconstructed samples of the current block based on the prediction samples and the residual samples of the current block, wherein the performing the secondary inverse-transform comprises: determining a non-separable transform matrix based on an intra prediction mode of the current block; and applying the non-separable transform matrix to the secondary-transformed coefficients of the current block, and wherein an input length and an output length of the secondary inverse-transform are respectively determined as 8 and 16, based on a size of the current block being 4×4.
 14. The method of claim 13, wherein the applying the non-separable transform matrix comprises: applying the non-separable transform matrix to a number of the secondary-transformed coefficients corresponding to the input length among the secondary-transformed coefficients of the current block.
 15. The method of claim 13, wherein the input length and the output length of the secondary inverse-transform are respectively determined as 16 and 16, based on each of a height and a width of the current block being not equal to
 8. 16. The method of claim 15, wherein applying the non-separable transform matrix comprises: applying the non-separable transform matrix to a top-left 4×4 region of the current block based on that each of the height and the width of the current block is not equal to 4 and a multiplication of the width and the height is less than a threshold value.
 17. The method of claim 13, wherein the performing the secondary inverse-transform further comprises: determining a non-separable transform set index based on the intra prediction mode; determining a non-separable transform kernel related to a non-separable transform index in a non-separable transform set indicated by the non-separable transform set index; and determining the non-separable transform matrix from the non-separable transform kernel based on the input length and the output length.
 18. A method for encoding an image signal, comprising: performing intra prediction on a current block to generate prediction samples of the current block; generating residual samples of the current block based on the prediction samples; performing primary transform on the residual samples of the current block to generate primary-transformed coefficients of the current block; and performing secondary transform on the primary-transformed coefficients of the current block, wherein the performing the secondary transform comprises: determining a non-separable transform matrix based on an intra prediction mode of the current block; and applying the non-separable transform matrix to the primary-transformed coefficients of the current block, and wherein an input length and an output length of the secondary transform are respectively determined as 16 and 8 based on a size of the current block being 4×4.
 19. The method of claim 18, wherein the applying the non-separable transform matrix comprises: applying the non-separable transform matrix to a number of the primary-transformed coefficients corresponding to the input length among the primary-transformed coefficients of the current block.
 20. The method of claim 18, wherein the input length and the output length of the secondary transform are respectively determined as 16 and 16, based on each of a height and a width of the current block being not equal to
 8. 21. The method of claim 20, wherein applying the non-separable transform matrix comprises: applying the non-separable transform matrix to a top-left 4×4 region of the current block based on that each of the height and the width of the current block is not equal to 4 and a multiplication of the width and the height is less than a threshold value.
 22. The method of claim 18, wherein the performing the secondary inverse-transform further comprises: determining a non-separable transform set index based on the intra prediction mode; determining a non-separable transform kernel related to a non-separable transform index in a non-separable transform set indicated by the non-separable transform set index; and determining the non-separable transform matrix from the non-separable transform kernel based on the input length and the output length.
 23. A non-transitory decoder-readable medium for storing a bitstream generated by a method according claim
 18. 24. A non-transitory decoder-readable medium for storing a bitstream generated by a method according claim
 19. 25. A non-transitory decoder-readable medium for storing a bitstream generated by a method according claim
 20. 26. A non-transitory decoder-readable medium for storing a bitstream generated by a method according to claim
 21. 27. A non-transitory decoder-readable medium for storing a bitstream generated by a method according to claim
 22. 